Why is it empty when I use php code to insert data to mysql? when I use php code to insert data to some fields in mysql, the inserted values are displayed as follows & lt ;? Php & nbsp; include (& quot; conn. php & quot;); & nbsp; if ($ _ POST [submit]) {& nbsp; $ SQL & quot; why does insertinto show null when I insert data into mysql using php code?
Why can I use php code to insert data to some fields in mysql when it is displayed as null? my code is as follows:
Include ("conn. php ");
If ($ _ POST ['submit ']) {
$ SQL = "insert into message (id, user, title, content, lastdate )".
"Value ('', '$ _ POST [user]', '$ _ POST [title]', '$ _ POST [content]', now ())";
Mysql_query ($ SQL );
Echo "published successfully ";
}
?>
Content in phpmyadmin
Id user title content lastdate
1. one of my headers is my PHP
2 _ my content your PHP 2012-04-15
------ Solution --------------------
Mysql_query ($ SQL) or die (mysql_error ());
Result!
You know what's going on.
------ Solution --------------------
Is there any problem with values?
------ Solution --------------------
User:
Text error