Why is it empty when I insert data into mysql using php code?
Source: Internet
Author: User
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 ['subm why I inserted data into mysql using php code is blank
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:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service