当前位置:网站首页>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
边栏推荐
- Assembly for unloading Loadfrom() loaded assembly - unloading the assembly loaded with assembly LoadFrom()
- Enterprise custom form engine solution (XI) -- form rule engine 1
- STM32 realizes 74HC595 control
- How to read the source code [debug and observe the source code]
- WEB-UI自动化测试-最全元素定位方法
- MySQL grouping query
- link preload prefetch
- A. Odd Selection【BruteForce】
- How to install PHP on Ubuntu 20.04
- 1164 Good in C
猜你喜欢
SQL injection database operation foundation
1164 Good in C
MySQL has been stopped in the configuration interface during installation
How to purchase Google colab members in China
QT学习日记9——对话框
Hongmeng fourth training
Automata and automatic line of non-standard design
Select 3 fcpx plug-ins. Come and see if you like them
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
Wechat applet for the first time
随机推荐
[LINUX]CentOS 7 安装MYSQL时报错“No package mysql-server available“No package zabbix-server-mysql availabl
Hongmeng fourth training
Research Report on competitive strategy Outlook Analysis and investment strategic planning of China's smart home equipment industry, 2022-2028
How to enforce parameters in PowerShell- How do I make parameters mandatory in PowerShell?
Market demand survey and marketing strategy analysis report of global and Chinese pet milk substitutes 2022-2028
Research Report on investment trends and development planning of China's thermal insulation material industry, 2022-2028
互聯網醫院HIS管理平臺源碼,在線問診,預約掛號 智慧醫院小程序源碼
Inheritance of ES6 class
How to deploy applications on kubernetes cluster
Analysis report on production and marketing demand and investment forecast of China's PVC industry from 2021 to 2026
ArrayList analysis 3: delete elements
互联网医院HIS管理平台源码,在线问诊,预约挂号 智慧医院小程序源码
[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)
How to purchase Google colab members in China
Internet Hospital his Management Platform source, online Inquiry, appointment Registration Smart Hospital Small program source
ArrayList分析3 : 删除元素
Graduation summary
QT adjust win screen brightness and sound size
A. Odd Selection【BruteForce】
Codeforces Round #803 (Div. 2) C. 3SUM Closure