Home > Backend Development > PHP Tutorial > PHP method to determine whether a record in the database exists, php database_PHP tutorial

PHP method to determine whether a record in the database exists, php database_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 10:14:09
Original
880 people have browsed it

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

http: //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...
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template