Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Return value type of mysqli_query ($conn, $sql) function

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article to share with you is about mysqli_query($conn, $sql) function return value type, Xiaobian think quite practical, so share to everyone to learn, I hope you can read this article after harvest, not much to say, follow Xiaobian to see it.

mysqli_query($conn, $sql) returns:

(1)DML: add, delete and modify, false if execution fails, true if successful

(2)DQL: check, execution fails to return false, successfully returns query result set object, there may be 0/1/N rows of data;

To get a row of data from it you can use:

$row=mysqli_fetch_row($result); fetch an index array or null

$row=mysqli_fetch_assoc($result); fetches an associative array or null

You can get all the rows from it using:

$rowList=mysqli_fetch_all($result, MYSQLI_ASSOC); fetches a two-dimensional array, each row rendered as an associative array

II. Classification of SQL statements:

DDL: Data Definition Language--Define Columns

CREATE / DROP / ALTER / TRUNCATE

DML: Data Manipulate Language--Action Lines

INSERT / DELETE / UPDATE

DQL: Data Query Language--does not affect data

SELECT

DCL: Data Control Language

GRANT / REVOKE

The above is the return value type of mysqli_query($conn, $sql) function. Xiaobian believes that some knowledge points may be seen or used in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report