当前位置:网站首页>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
边栏推荐
- Enterprise custom form engine solution (XI) -- form rule engine 1
- Select 3 fcpx plug-ins. Come and see if you like them
- Wechat applet for the first time
- PR second time
- 远程办公工具分享|社区征文
- Keepalived setting does not preempt resources
- Cloud primordial weekly | CNCF released the 2021 cloud primordial development status report, which was released on istio 1.13
- Remote office tools sharing | community essay solicitation
- Records of long objects and long judgments in the stream of list
- Supervisor monitors gearman tasks
猜你喜欢

STM32 realizes 74HC595 control

MySQL has been stopped in the configuration interface during installation

QT学习日记9——对话框

聊聊支付流程的設計與實現邏輯

Draw some simple graphics with MFC

Select 3 fcpx plug-ins. Come and see if you like them

How to purchase Google colab members in China

TensorBoard快速入门(Pytorch使用TensorBoard)

Is AI too slow to design pictures and draw illustrations? 3 sets of practical brushes to save you

Leetcode 108 converts an ordered array into a binary search tree -- recursive method
随机推荐
ArrayList analysis 3: delete elements
[combinatorics] recursive equation (case where the non-homogeneous part is exponential | example where the non-homogeneous part is exponential)
[combinatorics] recursive equation (the problem of solving recursive equation with multiple roots | the problem is raised)
The gbase 8A database does not support the DB2 function value (column_name, 0) cluster syntax
Golang单元测试、Mock测试以及基准测试
What is the difference between cloud server and cloud virtual machine
Notes on problems -- watching videos on edge will make the screen green
[combinatorics] generating function (linear property | product property)
Brief introduction to the core functions of automatic penetration testing tool
c# .net 工具生态
How to purchase Google colab members in China
Getting started with deops
AcWing 3438. 数制转换
i++与++i的区别:通俗易懂的讲述他们的区别
Leetcode Valentine's Day Special - looking for a single dog
Graduation summary
STM32 realizes 74HC595 control
Distributed task distribution framework gearman
[combinatorics] recursive equation (four cases where the non-homogeneous part of a linear non-homogeneous recursive equation with constant coefficients is the general solution of the combination of po
[combinatorics] recursive equation (special solution example 1 Hannover tower complete solution process | special solution example 2 special solution processing when the characteristic root is 1)