|
老師您好:我寫了一個程式做練習,結果不知道錯誤在哪裡,麻煩指點 建立資料庫: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); 這兩行有問題
|