hi all
i want to execute a sql query using php, which will create a new row in a table
i'm using
$result2 = mysql_query( "select *
from imc3
where userid = '$userid'");
$row2 = mysql_fetch_array($result2); //getting info from row in db
if ($num_rows==0)
{$result2 = mysql_query( "insert into imc3
(userid) values ('$_POST[userid]')");}[code=php]
this doesn't seem to work. i'm pretty sure i have the correct syntax.
i can run
insert into imc3 (userid) values ('test');
from the command line and it will create a new row, with only the column 'userid' populated with the word 'test'
can anyone tell me what's wrong with how i'm writing my php script?
thanks
philosophia