<?php $con=mysql_connect("localhost","root","1234567"); mysql_select_db("kelidestan"); // Check connection if (!$con){ die("به دلیل مشکل زیر، اتصال برقرار نشد : <br />" . mysql_error()); } $result = mysql_query("SELECT * FROM students",$con); echo "<table border='1'> <tr> <th>name</th> <th>mark</th> </tr>"; while($row = mysql_fetch_array($result)){ echo "<tr>"; echo "<td>" . $row['name'] . "</td>"; echo "<td>" . $row['mark'] . "</td>"; echo "</tr>"; } echo "</table>"; mysql_close($con); ?>
" . mysql_error());
}
$result = mysql_query("SELECT * FROM students",$con);
echo "
";
mysql_close($con);
?>
name | mark |
---|---|
" . $row['name'] . " | "; echo "" . $row['mark'] . " | "; echo "