Newbie... Tom has been learning this for three days and wrote a simple video, but... add. php file: & lt ;? Php & nbsp; $ conn = mysql_connect (& quot; localhost & quot;, & quot; root & quot;, & quot; 123 & quot;); & nbsp; new to mysq... tom here
After three days of learning, I wrote a simple video, ......
Add. php file: $ Conn = mysql_connect ("localhost", "root", "123 ");
Mysql_select_db ("test", $ conn );
If ($ _ POST ['send'])
{
If (mysql_query ("insert into totest (username, usertitle, usercontent, date) values ('$ _ POST [user]', '$ _ POST [title]', '$ _ POST [content]', now () ", $ conn ))
{
Echo "published successfully ";
}
Else echo ("Mysql error:". mysql_error ());
}
Mysql_close ();
?>
------ Solution --------------------
$ _ POST [title] is $ _ POST ['usertitle']...
Use the name of your input ......
------ Solution --------------------
Your form is name = "username" name = "usertitle" and your php $ _ POST [user] ',' $ _ POST [title] ', '$ _ POST [content] cannot be obtained.
------ Solution --------------------
This is not a shame! Minor omissions
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