Thank you !! & Lt ;? Phprequire_once (conn. php); if (mysql_query (insert & nbsp; into & nbsp; name & nbsp; set & nbsp; name $ name, tel $ tel, email $ email, QQ $ QQ, sex $ sex, brandname $ brandna. thank you !!
Require_once ("conn. php ");
If (mysql_query ("insert into name set name = '$ name', tel =' $ tel ', email =' $ email ', QQ =' $ QQ ', sex = '$ sex', brandname = '$ brandname', commoditybrand =' $ commoditybrand ', productID =' $ productID ', ordername =' $ ordername ', shopname = '$ shopname', shopaddr =' $ shopaddr ', invoicenumber =' $ invoicenumber ', purchasingdate =' $ purchasingdate' ", $ conn )){
Echo "added successfully! ";
}
Else {
Echo 'failed to add! ';
}
?>
Error:
Notice: Undefined variable
Warning: mysql_query () expects parameter 2 to be resource, null given in
------ Solution ----------------------
$ Conn variable undefined
Check the definition and loading of the conn. php file.