Home  >  Article  >  Backend Development  >  Mysql and php link

Mysql and php link

不言
不言Original
2018-06-02 16:21:231187browse

This article mainly introduces the link between mysql and php, which has certain reference value. Now I share it with everyone. Friends in need can refer to it

mysql establishment link:

Problem Solving

php.ini loads the mysql component

1.extension=php_mysql.dl prefix: remove

2.extension_dir=" "Is the path correct

php link mysql function

mysql_connect: open mysql link

mysql_sqlselect_db: open a database

Link format

mysql_connect("host","host Name", "Password"):

mysql_select_db ("Open database", link identifier): Link identifier, generally defaults to the last opened link

Whether the link is successful

Open the database

Execute sql statement:

Insert

Query

Multiple query display

";               [name]可以是数组下标也可以是域名
}
?>

Solution Chinese garbled characters

mysql_query("set names'gbk');

Related recommendations:

Key points of connection operation between MySQL and php

The above is the detailed content of Mysql and php link. For more information, please follow other related articles on 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