当前位置:网站首页>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
边栏推荐
- Classroom attendance system based on face recognition tkinter+openpyxl+face_ recognition
- PHP returns 500 errors but no error log - PHP return 500 error but no error log
- i++与++i的区别:通俗易懂的讲述他们的区别
- Cloud primordial weekly | CNCF released the 2021 cloud primordial development status report, which was released on istio 1.13
- Leetcode Valentine's Day Special - looking for a single dog
- How to purchase Google colab members in China
- 聊聊支付流程的設計與實現邏輯
- 1146_ SiCp learning notes_ exponentiation
- Global and Chinese pediatric palliative care drug market development research and investment planning recommendations report 2022-2028
- MinGW compile boost library
猜你喜欢

Internet Hospital his Management Platform source, online Inquiry, appointment Registration Smart Hospital Small program source

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

Research Report on market demand and investment planning for the development of China's office chair industry, 2022-2028

Deops入门

How to deploy applications on kubernetes cluster

(9) Opencv Canny edge detection

Getting started with deops

SQL injection database operation foundation

STM32 realizes 74HC595 control

How to install PHP on Ubuntu 20.04
随机推荐
Ssl/bio of OpenSSL_ get_ fd
Where is the database account used when running SQL tasks in data warehouse tasks configured
Kotlin's collaboration: Context
Stm32h7 Hal library SPI DMA transmission has been in busy solution
Introduction to SolidWorks gear design software tool geartrax
互聯網醫院HIS管理平臺源碼,在線問診,預約掛號 智慧醫院小程序源碼
Where is the monitoring page of RDS database?
Interviewer: why is the value nil not equal to nil?
How to purchase Google colab members in China
MinGW compile boost library
基于人脸识别的课堂考勤系统 tkinter+openpyxl+face_recognition
Kotlin的协程:上下文
Life perception 1
WEB-UI自动化测试-最全元素定位方法
vs2013已阻止安装程序,需安装IE10
微服务组件Sentinel控制台调用
[教程]在 CoreOS 上构建你的第一个应用
Records of long objects and long judgments in the stream of list
[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)
1147_ Makefile learning_ Target files and dependent files in makefile