Simple sql insert statement question

pushVTEC

Senior member
Aug 30, 2003
265
0
0
this line $query = "INSERT INTO COUNTDOWN(userid, cdownname, datezero, accessmode)
VALUES($user, '$name', '$date', '$ACC')";

errors $user = intval($_SESSION['userID']);

any ideas why it isn't working? userid requires an int, and i've tried just about everything it always puts in 0.
 

stndn

Golden Member
Mar 10, 2001
1,886
0
0
try to print out the $query value and see what the mysql query is (the one generated by php)
see if $user is indeed an integer

also try to check the column type of the table COUNTDOWN.
is the column userid set to accept integer?
 

pushVTEC

Senior member
Aug 30, 2003
265
0
0
Found the problem $user was used in the dbconnect script that i forgot out :( silly me ;( lol