当前位置:网站首页>PHP MySQL where clause
PHP MySQL where clause
2022-07-03 17:51:00 【Crooning ~ shallow singing】
WHERE Clause
WHERE Clause is used to extract records that meet the specified criteria .
grammar
SELECT column_name(s) FROM table_name WHERE column_name operator value
To learn more about SQL Knowledge , Please visit our SQL course .
In order to make PHP Execute the above statement , We have to use mysqli_query() function . This function is used to send a message to MySQL Connect to send queries or commands .
example
The following example will start from "Persons" Select all in the table FirstName='Peter' The line of :
<?php
$con=mysqli_connect("localhost","username","password","database");
// Detection connection
if (mysqli_connect_errno())
{
echo " The connection fails : " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT * FROM Persons
WHERE FirstName='Peter'");
while($row = mysqli_fetch_array($result))
{
echo $row['FirstName'] . " " . $row['LastName'];
echo "<br>";
}
?>The above code will be output :
Peter Griffin
边栏推荐
猜你喜欢

Automata and automatic line of non-standard design

QT学习日记9——对话框

Five problems of database operation in commodity supermarket system

Leetcode Valentine's Day Special - looking for a single dog
![[set theory] order relation: summary (partial order relation | partial order set | comparable | strictly less than | covering | hasto | total order relation | quasi order relation | partial order rela](/img/df/a034032e203e7935dafaf8a71cb6c8.jpg)
[set theory] order relation: summary (partial order relation | partial order set | comparable | strictly less than | covering | hasto | total order relation | quasi order relation | partial order rela

Research on Swift

Global and Chinese pediatric palliative care drug market development research and investment planning recommendations report 2022-2028

POM in idea XML graying solution
![How to read the source code [debug and observe the source code]](/img/40/a2fca67bcde3c468a739c6990325f4.jpg)
How to read the source code [debug and observe the source code]
![[combinatorics] generating function (summation property)](/img/74/e6ef8ee69ed07d62df9f213c015f2c.jpg)
[combinatorics] generating function (summation property)
随机推荐
Talk about the design and implementation logic of payment process
Mathematical formula (test)
Golang unit test, mock test and benchmark test
Embedded-c language-7
一入“远程”终不悔,几人欢喜几人愁。| 社区征文
Global and Chinese health care OEM and ODM market status survey and investment planning recommendations report 2022-2028
聊聊支付流程的设计与实现逻辑
QT learning diary 9 - dialog box
Where is the monitoring page of RDS database?
The third day of writing C language by Yabo people
QT学习日记9——对话框
Leetcode Valentine's Day Special - looking for a single dog
Ssl/bio of OpenSSL_ get_ fd
1164 Good in C
STM32 realizes 74HC595 control
Discussion sur la logique de conception et de mise en oeuvre du processus de paiement
Play with fancy special effects. This AE super kit is for you
聊聊支付流程的设计与实现逻辑
Applet with multiple tabs and Swipers + paging of each tab
Automata and automatic line of non-standard design