=-Thank you very much for your guidance ~ Solution

Source: Internet
Author: User
-Thank you very much for your guidance ~ & Lt ;? Phpecho & nbsp; Name :. $ _ POST [name]. & lt; br & gt; & nbsp; echo & nbsp; $ _ POST [price]. & lt; br & gt; & nbsp; echo & nbsp; $ _ POST [type]. & lt; br & gt; & nbsp; e =-thank you very much for your guidance ~


Echo "name:". $ _ POST ['name']."
";
// Echo $ _ POST ['price']."
";
// Echo $ _ POST ['type']."
";
// Echo $ _ POST ['name']."
";
Echo "tel:". $ _ POST ['Tel ']."
";
Echo "email:". $ _ POST ['email ']."
";
Echo "QQ:". $ _ POST ['QQ']."
";
Echo "address:". $ _ POST ['addr ']."
";
Echo "gender:". $ _ POST ['sex']."
";
Echo "product name:". $ _ POST ['brandname']."
";
Echo "brand:". $ _ POST ['commoditybrand']."
";
Echo "product No.:". $ _ POST ['produd d']."
";
Echo "product No.:". $ _ POST ['ordername']."
";
Echo "shop name:". $ _ POST ['shopname']."
";
Echo "shop address:". $ _ POST ['shopadd']."
";
Echo "Invoice No.:". $ _ POST ['invoicenumber']."
";
Echo "purchase date:". $ _ POST ['purchasingdate']."
";


$ Dingdanhao = date ("Y-m-dH-I-s ");
$ Dingdanhao = str_replace ("-", "", $ dingdanhao );
$ Dingdanhao. = rand (1000,2000 );

Echo "warranty No.:". $ dingdanhao;


$ Name = $ _ POST ['name'];
$ Tel = $ _ POST ['tel'];
$ Email = $ _ POST ['email '];
$ QQ =$ _ POST ['QQ'];
$ Sex = $ _ POST ['Sex '];
$ Brandname = $ _ POST ['brandname'];
$ Commoditybrand =$ _ POST ['commoditybrand'];
$ ProductID = $ _ POST ['produd d'];
$ Ordername = $ _ POST ['ordername'];
$ Shopname = $ _ POST ['shopname'];
$ Shopaddr = $ _ POST ['shoppaddr '];
$ Invoicenumber = $ _ POST ['invoicenumber'];
$ Purchasingdate = $ _ POST ['purchasingdate'];


Require_once ("conn. php ");
If (mysql_query ("insert into name set

Name = '$ name', tel =' $ Tel', email = '$ email', QQ = '$ QQ', sex =' $ sex ', brandname = '$ brandname', commodity

Brand = '$ commoditybrand', productID =' $ productID ', ordername =' $ ordername', shopname = '$ shopname ',

Shopaddr = '$ shopaddr', invoicenumber = '$ invoicenumber', purchasingdate = '$ purchasingdate '",

$ Conn )){
Echo "added successfully! View database ";
}
Else {
Echo 'failed to add! ';
}

Mysql_close ($ con );
?>

The error report is as follows:
Notice: Undefined variable: con in D: \ wamp \ www \ WWW \ post. php on line 55
Call Stack


(! ) Warning: mysql_close () expects parameter 1 to be resource, null given in D: \ wamp \ www \ post. php on line 55

=-Help
------ Solution ----------------------
Mysql_close ($ con); change to mysql_close ($ conn );
------ Solution ----------------------
$ Con is wrong. it should be $ conn.

You have written the program above.
Mysql_query ("insert into name set

Name = '$ name', tel =' $ Tel', email = '$ email', QQ = '$ QQ', sex =' $ sex ', brandname = '$ brandname', commodity

Brand = '$ commoditybrand', productID =' $ productID ', ordername =' $ ordername', shopname = '$ shopname ',

Shopaddr = '$ shopaddr', invoicenumber = '$ invoicenumber', purchasingdate = '$ purchasingdate '",

$ Conn ))

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.