[請益] 麻煩除錯,用php寫的成績查詢程式

看板PHP作者 (努力)時間15年前 (2010/06/27 19:17), 編輯推噓1(105)
留言6則, 4人參與, 最新討論串1/1
建立資料庫:abc 建立兩個資料表:11(包含id和pass欄位)22(包含id和num欄位) 有三個檔案:index.php config.php show.php config.php內容 <?php $link = mysql_connect("localhost","root","1234"); mysql_select_db("abc",$link); ?> index.php內容 <?php include "config.php"; ?> <html> <head><title>成積查詢</title> </head> <body> <form action="show.php" name="sss" method="post"> 暱稱:<input type="text" size="20" name="id"><br> 密碼:<input type="password" size="20" name="passwd"> <input type="submit" name="act" value="確定"> </form> </body> </html> show.php內容<html> <head><title>成績是</title> </head> <body> <? include "config.php"; $id=$_POST['id']; $pass=$_POST['passwd']; $result="select,id,num from 22 where id='$id'"; $rs1=mysql_query($result,$link); $row=mysql_num_rows($rs1); list($id,$num)=mysql_fetch_row($rs1); echo $id; echo $num; ?> </body> </html> 結果網頁顯示show.php $row=mysql_num_rows($rs1); list($id,$num)=mysql_fetch_row($rs1); 這兩行有問題 麻煩指點 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.171.196.196

06/27 20:03, , 1F
$passed是路人甲?
06/27 20:03, 1F

06/27 20:04, , 2F
TABLE NAME是數字?
06/27 20:04, 2F

06/27 20:20, , 3F
感謝指教
06/27 20:20, 3F

06/27 22:52, , 4F
成"績"
06/27 22:52, 4F

06/27 22:53, , 5F
index.php裡面 (被拖走
06/27 22:53, 5F

06/28 14:29, , 6F
語法錯 多個, select,id,num from
06/28 14:29, 6F
文章代碼(AID): #1C9pDJ67 (PHP)
文章代碼(AID): #1C9pDJ67 (PHP)