I've been mulling over this for about a week now and I really cannot see how this is failing.
I have quite a simple database which I can list the records of. What I am attempting to do now is to add new records to the table. I've done this before and I'm really just reusing the code from previous installations, but this just doesn't want to play ball.
I have a form for inputting new data which I then POST to a new script to save into the table.
So the start of the ADD script sets the POST variables sent from my form. Then I add the SQL INSERT statement using these variables (or some of them) to insert into the table. The problem is I constantly get this error:
My INSERT statement looks like this:
Any ideas?
Let me know what other info you might require. I will be very pleased if someone can put their finger on this!
I have quite a simple database which I can list the records of. What I am attempting to do now is to add new records to the table. I've done this before and I'm really just reusing the code from previous installations, but this just doesn't want to play ball.
I have a form for inputting new data which I then POST to a new script to save into the table.
So the start of the ADD script sets the POST variables sent from my form. Then I add the SQL INSERT statement using these variables (or some of them) to insert into the table. The problem is I constantly get this error:
Code:
Database ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc) VALUES ( , 1, testing)' at line 1
My INSERT statement looks like this:
Code:
$sql = "INSERT INTO po (supplier_id,createdby_id,desc) VALUES ( $s_id, 1, $desc)";
Any ideas?
Let me know what other info you might require. I will be very pleased if someone can put their finger on this!