entering datas of php page to database

Posted by Rahima farzana.S on Stack Overflow See other posts from Stack Overflow or by Rahima farzana.S
Published on 2011-03-04T06:59:54Z Indexed on 2011/03/04 7:25 UTC
Read the original article Hit count: 150

Filed under:
|

I have a php form with two text boxes and i want to enter the text box values into the database. I have created the table (with two columns namely webmeasurementsuite id and webmeasurements id) I used the following syntax for creating table:

CREATE TABLE `radio` (

`webmeasurementsuite id` INT NOT NULL,
`webmeasurements id` INT NOT NULL

);

Utilising the tutorial in the following link, I wrote the php coding but unfortunately the datas are not getting entered into the database. I am getting an error in the insert sql syntax. I checked it but i am not able to trace out the error.Can anyone correct me? I got the coding from http://www.webune.com/forums/php-how-to-enter-data-into-database-with-php-scripts.html $sql = "INSERT INTO $db_table(webmeasurementsuite id,webmeasurements id) values

('".mysql_real_escape_string(stripslashes($_REQUEST['webmeasurementsuite

id']))."','".mysql_real_escape_string(stripslashes($_REQUEST['webmeasurements id']))."')"; echo$sql; My error is as follows: INSERT INTO radio(webmeasurementsuite id,webmeasurements id) values ('','')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 'id,webmeasurements id) values ('','')' at line 1

© Stack Overflow or respective owner

Related posts about sql

Related posts about php5