Home > Backend Development > PHP Tutorial > mysqli的联接与操作分离

mysqli的联接与操作分离

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 12:19:16
Original
855 people have browsed it

mysqli的连接与操作分离
我在这页面已经写好数据库连接:

然后在其他页面上:include 'mysql_connect.php';
能封装好mysql_connect呢?
然后怎么用mysqli_query来操作呢?不想每次都用 global。
------解决思路----------------------
封装啊!
可以封成一个函数
也可以封装成一个类

Related labels:
source:php.cn
Statement of this Website
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
Latest Issues
Can't connect
From 1970-01-01 08:00:00
0
0
0
How to connect to the database with node.js
From 1970-01-01 08:00:00
0
0
0
websocket cannot connect
From 1970-01-01 08:00:00
0
0
0
python2.7 - django cannot connect to redis
From 1970-01-01 08:00:00
0
0
0
mysql-front failed to connect to database
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template