當前位置:編程學習大全網 - 網站源碼 - 急.PHP高手進來!分全給妳

急.PHP高手進來!分全給妳

沒有數據表的信息。寫出來的話也要改的。

把select * from student裏的student改成數據庫裏學生信息對應的表名

把where id = 中的id改成數據庫裏面對應學號的字段名

把$row['name']和$row['class']裏的name和class也對應的改掉就可以用了

文件內容:

<?

if(isset($_POST["submited"]))

{

$student_no = $_POST["s_no"];

$sql = "select * from student where id = $student_no";

mysql_connect('localhost','php','php');

mysql_select_db('php_kaoshi');

$query = mysql_query($sql);

$row = mysql_fetch_row($query);

echo "姓名:${row['name']} <br /> 學號:$student_no <br /> 班級: ${row['class']}";

}

else

{

>

<form action="GetFen.php" method="post">

<input type="hidden" name="submited" value="1" />

<input name="s_no" type="text" /><button type="submit">查詢</button>

</form>

<?php

}

>

  • 上一篇:請幫我寫壹個通達信選股公式 要求收盤價上穿5 10 20 30日均線 突破籌碼峰密集區 謝謝
  • 下一篇:Win7無法使用交通銀行網銀,無法加載pkcs#11或統壹接口庫(huqda)。
  • copyright 2024編程學習大全網