Simple Problems taking me hours to solve!
| From: | Steve Jackson | Date: | Fri, 01 Nov 2002 08:21:21 +0000 |
| Subject: | Simple Problems taking me hours to solve! | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-122393@lists.php.net to get a copy of this message | ||
This is the query I am running on my database:
$query = "select orderid from receipts order by receipt_id DESC LIMIT
0,1";
$orderid = mysql_query($query);
That should return the last record in the DB? Correct?
I currently get a number returned which is the number plus 1.
IE if 423 is the last DB record then 424 is returned.
Any ideas why this happens?
Also in the same table I have a shipping price variable.
My query for this is:
$query = "select shipping from receipts order by receipt_id DESC LIMIT
0,1";
$shipping_cost = mysql_query($query);
Again this should return the last record?
It doesn't return anything however. Any ideas?
Steve Jackson
Web Developer
Viola Systems Ltd.
http://www.violasystems.com <http://www.violasystems.com/>
stephen.jackson@violasystems.com
Mobile +358 50 343 5159