php修改資料庫出現問題

來源:互聯網
上載者:User



這個是guanli_ok.php


點擊提交後調到guanli_ok.php 但是那邊空白一片 也不會提示修改成功或者失敗 是什麼原因啊。。求解決方案


回複討論(解決方案)

SQL 串寫錯了
$insert=mysql_query("update tb_book set pwd='$xpwd',section='$section',name='$section' where id='$user' AND pwd='pwd'",$conn);

改了之後還是沒反應,,,

SQL 串寫錯了
$insert=mysql_query("update tb_book set pwd='$xpwd',section='$section',name='$section' where id='$user' AND pwd='pwd'",$conn);

還是沒反應啊。。

請你開啟 php 的錯誤顯示功能

請你開啟 php 的錯誤顯示功能

開啟了 但是還是空白一片


if(isset($_POST['Submit']) and $_POST['Submit']=="提交"){ 不用解釋了吧。。。


if(isset($_POST['Submit']) and $_POST['Submit']=="提交"){ 不用解釋了吧。。。

已改 但是還是空白。,。



if(isset($_POST['Submit']) and $_POST['Submit']=="提交"){ 不用解釋了吧。。。

已改 但是還是空白。,。


你沒進if

if(isset($_POST['xiugai']) and $_POST['Submit']=="確認修改"){

          

if(isset($_POST['Submit']) and $_POST['Submit']=="提交"){ 不用解釋了吧。。。

已改 但是還是空白。,。

你沒進if if(isset($_POST['xiugai']) and $_POST['xiugai']=="確認修改"){

...

php.ini 中
display_errors = On
重啟 網頁伺服器

你的錯誤實際產生於 conn/conn.php

如果你的錯誤顯示是開啟的話
$insert=mysql_query("update tb_book set pwd='$xpwd',section='$section',name='$section' where id='$user' pwd='pwd'",$conn); //執行更新操作
echo mysql_error(); //這裡一定是有輸出的,因為 sql 指令錯了

conn




錯誤

Object not found!
The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

If you think this is a server error, please contact the webmaster.

Error 404
localhost
06/30/15 13:38:48
Apache/2.2.9 (APMServ) mod_ssl/2.2.9 OpenSSL/0.9.8h PHP/5.2.6

Object not found!
The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

If you think this is a server error, please contact the webmaster.

Error 404
localhost
06/30/15 13:38:48
Apache/2.2.9 (APMServ) mod_ssl/2.2.9 OpenSSL/0.9.8h PHP/5.2.6




你開始說是guanli_ok.php 你是guanl_ok.php


Object not found!
The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

If you think this is a server error, please contact the webmaster.

Error 404
localhost
06/30/15 13:38:48
Apache/2.2.9 (APMServ) mod_ssl/2.2.9 OpenSSL/0.9.8h PHP/5.2.6




你開始說是guanli_ok.php 你是guanl_ok.php

我改了 開啟發現是空白的。。


Object not found!
The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

If you think this is a server error, please contact the webmaster.

Error 404
localhost
06/30/15 13:38:48
Apache/2.2.9 (APMServ) mod_ssl/2.2.9 OpenSSL/0.9.8h PHP/5.2.6




你開始說是guanli_ok.php 你是guanl_ok.php

沒有錯誤提示

php.ini 中
display_errors = On
重啟 網頁伺服器

你的錯誤實際產生於 conn/conn.php

如果你的錯誤顯示是開啟的話
$insert=mysql_query("update tb_book set pwd='$xpwd',section='$section',name='$section' where id='$user' pwd='pwd'",$conn); //執行更新操作
echo mysql_error(); //這裡一定是有輸出的,因為 sql 指令錯了

是我conn錯了嗎?

print_r($_POST); 就能發現是個空數組,怎麼都不可能進入if裡面。肯定為空白了。

把你的form 定義改一改。
給 每個元素加上name 屬性。


submit 也是一樣,value改成value="提交"


改成


應該就能進入if分支了



Object not found!
The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

If you think this is a server error, please contact the webmaster.

Error 404
localhost
06/30/15 13:38:48
Apache/2.2.9 (APMServ) mod_ssl/2.2.9 OpenSSL/0.9.8h PHP/5.2.6




你開始說是guanli_ok.php 你是guanl_ok.php

沒有錯誤提示



你開啟一個不存在的頁面 當然是報404了。。。
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    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.