[請益] 麻煩除錯,用php寫的成績查詢程式
建立資料庫: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
06/27 20:03, 1F
→
06/27 20:04, , 2F
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
06/27 22:53, 5F
推
06/28 14:29, , 6F
06/28 14:29, 6F
PHP 近期熱門文章
PTT數位生活區 即時熱門文章