PHPMySQLWhere子句学习
时间:2021-07-01 10:21:17
帮助过:19人阅读
$con = mysql_connect("localhost","peter","abc123"); - if (!$con)
- {
- die('Could not connect: ' . mysql_error());
- }
mysql_select_db("my_db", $con); $result = mysql_query("SELECT * FROM Persons - WHERE FirstName='Peter'");
while($row = mysql_fetch_array($result)) - {
- echo $row['FirstName'] . " " . $row['LastName'];
- echo "
"; - }
?> -
输出:
Peter Griffin |