PHP method to determine whether records in the database exist, php database
The example in this article describes how PHP determines whether a record in the database exists. Share it with everyone for your reference.
The specific implementation code is as follows:
Copy code The code is as follows:
$sql="select * from checklist where game_id=$gid and task='$task' and status='$status'";
$result=mysql_query($sql);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
If (!mysql_num_rows($result))
echo "record doesn't exist~~~~~!!!!!";
else else
// echo mysql_num_rows($result)."n";
echo $row['game_id'];
echo $row['task'];
?>
I hope this article will be helpful to everyone’s PHP programming design.
http://www.bkjia.com/PHPjc/911903.html
www.bkjia.com
truehttp: //www.bkjia.com/PHPjc/911903.htmlTechArticleHow PHP determines whether a record in the database exists, php database This article describes an example of PHP determining whether a record in the database exists method of existence. Share it with everyone for your reference. Specifically...