Home  >  Article  >  Backend Development  >  PHP connects to MySQL to perform add, delete, modify and query operations

PHP connects to MySQL to perform add, delete, modify and query operations

高洛峰
高洛峰Original
2017-02-21 15:31:281364browse

This article mainly introduces the method of PHP connecting to MySQL to perform add, delete, modify and query operations. It has a very good reference value. Let’s take a look at it with the editor.

Not much to say Please look at the code:


# , ,


# Fetch_all () Back to all arrays

# FETCH_ROW ()

# FETCH_ASSOC () Return to the associated array

FETCH_OBJECT () Return to the object

# FETCH_ARAY () The array of arrays returned has both indexes and associated

steals Delete, add, and modify operations


query($sql);
4.判断返回是否执行成功
if($reslut)
{
while($attr = $reslut->fetch_row())
{
echo "";
}
}
?>
代号 姓名 性别 民族 生日
{$attr[0]} {$attr[1]} {$attr[2]} {$attr[3]} {$attr[4]}

For more articles related to PHP connecting to MySQL for add, delete, modify, and check operations, please pay attention to the PHP Chinese website!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn