wap3
11-21-2002, 03:13 PM
Hi
Can somebody tell me why this wont work. It is supposed to fecth the highest value in the field Item_id.
It wont work though. It just returns 'no' which I put there to see if it wasn't retreiving anything ??
Thanks
function display_add_item_form() {
$conn = db_connect(); //connect to database
$query = mysql_query("SELECT Item_id FROM products ORDER BY Item_id DESC LIMIT 1");
$result = mysql_query($query);
if (!$result)
echo "no";
$newid = $result;
print ("$newid");
}
Can somebody tell me why this wont work. It is supposed to fecth the highest value in the field Item_id.
It wont work though. It just returns 'no' which I put there to see if it wasn't retreiving anything ??
Thanks
function display_add_item_form() {
$conn = db_connect(); //connect to database
$query = mysql_query("SELECT Item_id FROM products ORDER BY Item_id DESC LIMIT 1");
$result = mysql_query($query);
if (!$result)
echo "no";
$newid = $result;
print ("$newid");
}