At 11:11 15.11.2002, Tim Thorburn said:
--------------------[snip]--------------------
>I'm creating a form which will allow individuals to add themselves to an 
>online database and ask if they'd like to upload a picture.  I have the 
>form setup which allows the individuals to add themselves - currently it 
>asks if they have a picture to upload (a yes or no drop menu).  On the 

 From a UI guide - it would be better to present either a checkbox, or two
radiobuttons, for a simple question like this. Basically:
is it a yes or no - use a checkbox (checked=yes)
is it two options - use radiobuttons

>screen after the individual adds them self, I'd like to check the database 
>for the last entry (the one just made) and then see if the picture column 
>has a yes or a no stored.
>
>What I don't know is how to select the last entry in a database ... I'm 
>sure its something very simple, but with being up until 5am working on this 
>site - it's slipped by caffeine powered brain.

Could be tricky and depends on your data layout.
(a) you have an auto-increment ID value, then
    select * from mytable where id = (select max(id) from mytable)
(b) you have a timestamp field, then
    select * from mytable where dt_entry = (select max(dt_entry) from mytable)

Note that the timestamp solution could easily produce duplicates while the
auto-increments do not.


-- 
   >O     Ernest E. Vogelsinger
   (\)    ICQ #13394035
    ^     http://www.vogelsinger.at/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to