Page 1 of 1

Last Record Query Result Problem

Posted: Tue Feb 24, 2004 7:29 pm
by saeen
i have used
$res = mysql_query("SELECT id FROM personal_info ORDER BY id DESC LIMIT 1 ");
and i think it shud return me the value of last id field
instead when i say
echo $res; it prints something like this Resource Id #3

help

Posted: Tue Feb 24, 2004 7:36 pm
by saeen
and yea one thing more thrz only one record in the database at the time

Posted: Tue Feb 24, 2004 7:47 pm
by AVATAr
why did you double post!!! i respond you in the original post!

Posted: Tue Feb 24, 2004 8:04 pm
by saeen
sorry abt the double post .. actually i needed help immediatly and then i didnt get a reply so i thought may be ppl wont read the old post so i posted again...but then u replied on the old one
sorry once again

can u tell me how to make a self call in the page..like im doin this if i don find a record i increase the value of $id+1 and then call the same page again how to do that??? used header but it says header info already sent dono any other way.

Posted: Tue Feb 24, 2004 8:14 pm
by AVATAr
You cant do $id + 1 because you dont know if it exists... you have to do it with the select i show you.

self call?

Posted: Tue Feb 24, 2004 8:16 pm
by saeen
no no $id + 1 from the database pro is solved
all i want to know is how can i make statement in a php page that actually redirects to itself u gettin me?

Posted: Tue Feb 24, 2004 8:24 pm
by AVATAr

Posted: Tue Feb 24, 2004 8:59 pm
by d3ad1ysp0rk
$val = mysql_result($res);
echo $val;