PHP Add to database table, how to solve

Source: Internet
Author: User
Adding PHP to a database table
Self-taught PHP, but also read some of the solutions, but still not. In the following cases, can not successfully add data to the database, I hope the big God pointing. This is my watch.




Untitled Document



$db = mysql_connect ("localhost", "root", "root");
mysql_select_db ("Test", $db);
if (Isset ($_post[' submit ') &&$_post[' submit '])
{

VALUES (' $_post[c_id] ', ' $_post[c_name ', ' $_post[sector ', ' $_post[e_address] ', ' $_post[mail_address ', ' $_post[ Classification] ' $_post[started_date] ', ' $_post[contact] ', ' $_post[con_address] ' now () ';
mysql_query ($sql);
echo "Success";
}
?>
echo "registered successfully";

?>





------Solution--------------------
1, the form control is not defined, are changed to the following:


2. The Submit button does not have a name value and will not enter the IF branch.
Name= "Submit">
  • Contact Us

    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

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.