久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      php怎么調(diào)試sql語句錯誤

      php調(diào)試sql語句錯誤的方法:1、通過die語句調(diào)試PHP SQL錯誤;2、通過“mysql_error”語句調(diào)試PHP SQL錯誤。

      php怎么調(diào)試sql語句錯誤

      本文操作環(huán)境:windows7系統(tǒng)、PHP7.1版,DELL G3電腦

      php怎么調(diào)試sql語句錯誤?

      通過die和mysql_error語句調(diào)試PHP SQL錯誤

      一、代碼

      <!--處理文件代碼--> <?php  $conn=mysql_connect('localhost','root','root') or die("與服務(wù)器連接失敗!");   mysql_select_db('db_database22',$conn) or die("沒有找到數(shù)據(jù)庫!");   if($_POST[Submit]=="提交"){ $admin=$_POST[admin];//獲取提交的用戶名 $pass=$_POST[pass];//獲取提交的密碼 $dates=date("Y-m-d H:i:s");//定義當(dāng)前時間 $query="insert into user (admin,password,dates) values('$admin','$pass','$dates')";//編寫添加語句 $result=mysql_query($query,$conn) or die(mysql_error()); //執(zhí)行添加語句,并返回錯誤信息     if($result){    echo "<script>alert('添加成功!'); window.location.href='index.php';</script>"; }else{  echo "添加失敗!!";  }     } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>SQL語句錯誤</title> </head> <style type="text/css"> <!-- .STYLE1 {color: #FF0000} --> </style> <body> <!--表單提交頁,設(shè)置的表單元素--> <form name="form1" method="post" action="index.php"> <table width="240" border="1" cellpadding="1" cellspacing="1" bordercolor="#FFFFFF" bgcolor="#FF0000">   <tr>     <td width="80" align="right" bgcolor="#FFFFFF"><span class="STYLE1">管理員:</span></td>     <td width="147" bgcolor="#FFFFFF"><input name="admin" type="text" id="admin" size="20"></td>   </tr>   <tr>     <td align="right" bgcolor="#FFFFFF"><span class="STYLE1">密碼:</span></td>     <td bgcolor="#FFFFFF"><input name="pass" type="password" id="pass" size="20"></td>   </tr>   <tr>     <td colspan="2" align="center" bgcolor="#FFFFFF"><input type="submit" name="Submit" value="提交"></td>   </tr> </table> </form> </body> </html>

      二、運(yùn)行結(jié)果

      Unknown column 'password' in 'field list'

      推薦學(xué)習(xí):《PHP視頻教程》

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號