php 数据库select函数//待编辑

<?php

$con = mysql_connect("localhost","root","root");

if (!$con)

{

die('Could not connect: ' . mysql_error());

}

mysql_select_db("sa", $con);

$result = mysql_query("SELECT * FROM doc");

echo"<table>";

while($row = mysql_fetch_array($result))

{

echo"<tr>";

$num=count($row);

for ($x=0; $x<$num; $x++)

{

echo "<td>";

echo $row[$x];

echo "</td>";

}

echo"</tr>";

}

echo"</table>";

mysql_close($con);

?>

上一篇:第三次作业:caculator


下一篇:局部(或全局)设置标签的target属性