This article mainly introduces how to use PHP to determine whether a record exists in the database. It is very practical to use mysql_num_rows to determine the query result. For more information, see
This article mainly introduces how to use PHP to determine whether a record exists in the database. It is very practical to use mysql_num_rows to determine the query result. For more information, see
This example describes how to use PHP to determine whether a record exists in a database. Share it with you for your reference.
The specific implementation code is as follows:
The Code is as follows:
<? Php
$ 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
{
// Echo mysql_num_rows ($ result). "\ n ";
Echo $ row ['game _ id'];
Echo $ row ['task'];
}
?>
I hope this article will help you with PHP programming.
,