Re: getting last entry in database table

From: Date: Sat, 17 Mar 2001 21:59:10 +0000
Subject: Re: getting last entry in database table
References: 1 2 3  Groups: php.db 
Request: Send a blank email to php-db+get-7569@lists.php.net to get a copy of this message
David Balatero wrote: > Do this: > > $querykb = "SELECT e_description FROM events WHERE t_id = '$t_id' ORDER BY > id desc"; > > where id is the unique id of each row. > Then it will order it like: > > Entry 2 > Entry 1 Yes, possibly. But it still doesn't add the last entry to the variable like I want it to. I want kb_answer to have the value "entry 2" (in your example) not as happens (even in your example) "entry 1". And, talking to a newbie it would be grate to know why my method produces the wrong result. Martin S.

« previous php.db (#7569) next »