The submission form inserts the data with insert into, but always blank, without prompting for an error. Excuse me, is there a problem?
@header ("content-type:text/html; Charset=utf-8 "); require_once ' inc/site_config.php '; require_once ' inc/db_connections.php '; require_once ' inc/ Function.php '; mysql_query (' Set character set "UTF8" '); Session_Start (); if ($_request[' action ']== ' Postreg ') {$sql _check_usr= "select * from ' Reguser ' where ' UserId ' = '". $_ session[' uid ']. "'"; $info =mysql_query ($sql _check_usr), $dingdanhao =date ("Ymjhis"). $info [UserId]; $SPC =$_session[producelist]; $SLC = $_ Session[quatity]; $shouhuoren =$_post[' trusername '); $dizhi =$_post[' address ']; $youbian =$_post[' phone ']; $tel =$_ post[' mob ']; $email =$_post[' email '];if (Trim ($_post[' d_content ') = = "") {$leaveword = "";} else{$leaveword =$_post[' D_ Content '];} $xiadanren =$_session[' uid ']; $time =date ("Y-m-j h:i:s"); $total =$_session[total]; $sql _add_usr= "INSERT into Onlineorder (Dingdanhao,spc,slc,username,address,phone,mobile,mail,yqinfo,ordertime, Userid,total_price) VALUES (' $dingdanhao ', ' $spc ', ' $slc ', ' $trusername ', ' $address ', ' $phone ', ' $mob ', ' $email ', ' $d ' _ Content ', ' $time ', ' $xiadAnren ', ' $total ') "; mysql_query ($sql _add_usr);}
Reply to discussion (solution)
Print out the SQL statements and run the SQL statements in tools such as phpMyAdmin to see what the results are.
This is a common method of checking SQL correctness.
$info =mysql_query ($sql _check_usr);
$dingdanhao =date ("Ymjhis"). $info [UserId];
$info is a result resource set, $info [UserId] does not use
mysql_query ($sql _add_usr) or Die (Mysql_error ()); See if it's an error.