当前位置:网站首页>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
边栏推荐
- 鸿蒙第三次培训
- SQL injection database operation foundation
- [mathematical logic] equivalent calculus and reasoning calculus of predicate logic (individual word | predicate | quantifier | predicate logic formula | two basic formulas | proposition symbolization
- As soon as we enter "remote", we will never regret, and several people will be happy and several people will be sad| Community essay solicitation
- [combinatorics] generating function (shift property)
- Global and Chinese pediatric palliative care drug market development research and investment planning recommendations report 2022-2028
- 聊聊支付流程的设计与实现逻辑
- [LINUX]CentOS 7 安装MYSQL时报错“No package mysql-server available“No package zabbix-server-mysql availabl
- Investigation on the operation prospect of the global and Chinese Anti enkephalinase market and analysis report on the investment strategy of the 14th five year plan 2022-2028
- STM32实现74HC595控制
猜你喜欢

Research Report on competitive strategy Outlook Analysis and investment strategic planning of China's smart home equipment industry, 2022-2028

Global and Chinese health care OEM and ODM market status survey and investment planning recommendations report 2022-2028

微服务组件Sentinel控制台调用

Implementation of Tetris in C language

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

鸿蒙第三次培训

How to install PHP on Ubuntu 20.04

Type conversion, variable

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

TCP拥塞控制详解 | 3. 设计空间
随机推荐
AcWing 3438. 数制转换
[LINUX]CentOS 7 安装MYSQL时报错“No package mysql-server available“No package zabbix-server-mysql availabl
Notes on problems -- watching videos on edge will make the screen green
Automata and automatic line of non-standard design
[Yu Yue education] family education SPOC class 2 reference materials of Shanghai Normal University
WEB-UI自动化测试-最全元素定位方法
Life perception 1
Hongmeng third training
Leetcode Valentine's Day Special - looking for a single dog
Where is the database account used when running SQL tasks in data warehouse tasks configured
PHP returns 500 errors but no error log - PHP return 500 error but no error log
STM32实现74HC595控制
Implementation of Tetris in C language
Graduation summary
Keepalived setting does not preempt resources
TCP congestion control details | 3 design space
Records of long objects and long judgments in the stream of list
List of financial products in 2022
BFS - topology sort
(8) HS corner detection