第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

為什么運行后只能輸出一行結果,我是想輸出滿足age=20的全部結果的。 代碼哪里寫錯了?

為什么運行后只能輸出一行結果,我是想輸出滿足age=20的全部結果的。 代碼哪里寫錯了?

Smart貓小萌 2023-03-06 18:14:47
數(shù)據(jù)庫中有一個表test為:id name age $sql="select * from test where age=20";$result=mysql_query($sql);echo "<table border='1' cellspacing=0px><tr><th>id</th><th>name</th><th>age</th></tr>";while ($row=mysql_fetch_array($result)) {echo "<tr>";echo "<td>".$row['id']."</td>";echo "<td>".$row['name']."</td>";echo "<td>".$row['age']."</td>";echo "</tr>";}echo "</table>";
查看完整描述

1 回答

?
守著星空守著你

TA貢獻1799條經(jīng)驗 獲得超8個贊

你使用的函數(shù)就是單條的。請換成mysql_fetch_field


<?php$con = mysql_connect("localhost""hello""321");if (!$con)  {  die('Could not connect: ' . mysql_error());  } $db_selected = mysql_select_db("test_db",$con); $sql "SELECT * from Person";$result = mysql_query($sql,$con); while ($property = mysql_fetch_field($result))  {  echo "Field name: " $property->name . "<br />";  echo "Table name: " $property->table . "<br />";  echo "Default value: " $property->def . "<br />";  echo "Max length: " $property->max_length . "<br />";  echo "Not NULL: " $property->not_null . "<br />"  echo "Primary Key: " $property->primary_key . "<br />";  echo "Unique Key: " $property->unique_key . "<br />"  echo "Mutliple Key: " $property->multiple_key . "<br />";  echo "Numeric Field: " $property->numeric . "<br />";  echo "BLOB: " $property->blob . "<br />";  echo "Field Type: " $property->type . "<br />";  echo "Unsigned: " $property->unsigned . "<br />";  echo "Zero-filled: " $property->zerofill . "<br /><br />"  } mysql_close($con);?>


查看完整回答
反對 回復 2023-03-08
  • 1 回答
  • 0 關注
  • 94 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號