Why is this statement not executed? PHPcode $ query = mysql_query (& quot; insertintoyc_jiage (yc_jiage, add_date, yc_name, yc_id) values ($ _ price1, $ _ date1, 'sweater '', null) & quot;); why is this statement not executed?
PHP code
$ Query = mysql_query ("insert into yc_jiage (yc_jiage, add_date, yc_name, yc_id) values ($ _ price1, $ _ date1, 'sweater'', null )");
Insert statement, no prompt, but data is not inserted!
PHP code
echo $_date1
The display is normal, indicating that the variable is correct!
$ _ Price1 and $ _ date1 are all variables received by POST!
The yc_id field in the table increases automatically.
------ Solution --------------------
Mysql_query ("insert into yc_jiage (yc_jiage, add_date, yc_name) values ($ _ price1, $ _ date1, 'sweater ')");
Try it?
------ Solution --------------------
$ Query = mysql_query ("insert into yc_jiage (yc_jiage, add_date, yc_name, yc_id) values ('$ _ price1', '$ _ date1', 'sweater'', null) ") or die (mysql_error ());
Try this way. If the error message is returned.
------ Solution --------------------
$ Query = mysql_query ("insert into yc_jiage (yc_jiage, add_date, yc_name, yc_id) values ('$ _ price1', '$ _ date1', 'sweater ', null) ");