Insert PHP variable in to MySQL database?
I have an integer stored in a variable named $userid and am trying to insert it in to a MySQL database.
I have been trying to use the following query:
$query = "INSERT INTO rota (userid, person) VALUES ('$userid','".db_escape($_POST['person'])."')";
Now, the query executes with no problem and the person value is correctly stored in the database. However, the userid variable inserts as '0' even though the value is actually '65'.
I have been trying everything I can for hours and no matter what I do the query always inserts '0' instead of the actual value of $userid which is '65'.
Any help at all would be HUGELY appreciated!
Thank you in advance.
Users Browsing this Thread
There are currently 2 users browsing this thread. (0 members and 2 guests)
Tags for this Thread