selecting the unique id for mysql
Posted: Wed Apr 20, 2005 7:33 pm
Hi
Can anyone see a syntax prob here?
fname and sname exist but it doesnt assign the personid from the table to
$personid.
I have switched fname = $fname and sname = $sname as well, used '' and "" around the variables. It doesnt want to get the id.
this is the file after submission from a form. AS i want to get the id created in the dB of the entry i just made to use. Is there another way to get the id?
thanks
feyd | Please review how to post code using
Can anyone see a syntax prob here?
Code: Select all
$fname = $HTTP_POST_VARS["fname"];
$sname = $HTTP_POST_VARS["sname"];
echo $fname;
echo $sname;
$db = mysql_connect("localhost", "root");
mysql_select_db("tester",$db);
$personid = mysql_query("select personid
from people where
$fname = fname and $sname = sname",$db);$personid.
I have switched fname = $fname and sname = $sname as well, used '' and "" around the variables. It doesnt want to get the id.
this is the file after submission from a form. AS i want to get the id created in the dB of the entry i just made to use. Is there another way to get the id?
thanks
feyd | Please review how to post code using
Code: Select all
andCode: Select all
tags. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]