php mysqli error_error()的问题

//procedural&style
$mysqli&=&&mysqli_connect('host','username','password','database_name');
//object&oriented&style&(recommended)
$mysqli&=&new&mysqli('host','username','password','database_name');
推荐下面的方式
//Open&a&new&connection&to&the&MySQL&server
$mysqli&=&new&mysqli('host','username','password','database_name');
//Output&any&connection&error
if&($mysqli-&connect_error)&{
&&&&die('Error&:&('.&$mysqli-&connect_errno&.')&'.&$mysqli-&connect_error);
2.选择多行
mysqli_fetch_assoc()&: Below is the code to fetch multiple records as an associative array. The returned array holds the strings fetched from database, where the column names will be the key used to access the internal data. As you can see below, data is displayed in an HTML table.
//Open&a&new&connection&to&the&MySQL&server
$mysqli&=&new&mysqli('host','username','password','database_name');
//Output&any&connection&error
if&($mysqli-&connect_error)&{
&&&&die('Error&:&('.&$mysqli-&connect_errno&.')&'.&$mysqli-&connect_error);
//MySqli&Select&Query
$results&=&$mysqli-&query("SELECT&id,&product_code,&product_desc,&price&FROM&products");
print&'&table&border="1"&';
while($row&=&$results-&fetch_assoc())&{
&&&&print&'&tr&';
&&&&print&'&td&'.$row["id"].'&/td&';
&&&&print&'&td&'.$row["product_code"].'&/td&';
&&&&print&'&td&'.$row["product_name"].'&/td&';
&&&&print&'&td&'.$row["product_desc"].'&/td&';
&&&&print&'&td&'.$row["price"].'&/td&';
&&&&print&'&/tr&';
print&'&/table&';
//&Frees&the&memory&associated&with&a&result
$results-&free();
//&close&connection&
$mysqli-&close();
fetch_array()&: Function returns an array of both&&and&&merged together, it is an extended version of the mysqli_fetch_row() function and both numeric and string can be used as keys to access the data.
//Open&a&new&connection&to&the&MySQL&server
$mysqli&=&new&mysqli('host','username','password','database_name');
//Output&any&connection&error
if&($mysqli-&connect_error)&{
&&&&die('Error&:&('.&$mysqli-&connect_errno&.')&'.&$mysqli-&connect_error);
//MySqli&Select&Query
$results&=&$mysqli-&query("SELECT&id,&product_code,&product_desc,&price&FROM&products");
print&'&table&border="1"';
while($row&=&$results-&fetch_array())&{
&&&&print&'&tr&';
&&&&print&'&td&'.$row["id"].'&/td&';
&&&&print&'&td&'.$row["product_code"].'&/td&';
&&&&print&'&td&'.$row["product_name"].'&/td&';
&&&&print&'&td&'.$row["product_desc"].'&/td&';
&&&&print&'&td&'.$row["price"].'&/td&';
&&&&print&'&/tr&';
print&'&/table&';
//&Frees&the&memory&associated&with&a&result
$results-&free();
//&close&connection&
$mysqli-&close();
fetch_object()&: To fetch database result set as an objects, just use MySqli fetch_object(). The attributes of the object represent the names of the fields found within the result set.
//Open&a&new&connection&to&the&MySQL&server
$mysqli&=&new&mysqli('host','username','password','database_name');
//Output&any&connection&error
if&($mysqli-&connect_error)&{
&&&&die('Error&:&('.&$mysqli-&connect_errno&.')&'.&$mysqli-&connect_error);
//MySqli&Select&Query
$results&=&$mysqli-&query("SELECT&id,&product_code,&product_desc,&price&FROM&products");
print&'&table&border="1"&';
while($row&=&$results-&fetch_object())&{
&&&&print&'&tr&';
&&&&print&'&td&'.$row-&id.'&/td&';
&&&&print&'&td&'.$row-&product_code.'&/td&';
&&&&print&'&td&'.$row-&product_name.'&/td&';
&&&&print&'&td&'.$row-&product_desc.'&/td&';
&&&&print&'&td&'.$row-&price.'&/td&';
&&&&print&'&/tr&';
print&'&/table&';
//&close&connection&
$mysqli-&close();
5.选择单行
//Open&a&new&connection&to&the&MySQL&server
$mysqli&=&new&mysqli('host','username','password','database_name');
//Output&any&connection&error
if&($mysqli-&connect_error)&{
&&&&die('Error&:&('.&$mysqli-&connect_errno&.')&'.&$mysqli-&connect_error);
//chained&PHP&functions
$product_name&=&$mysqli-&query("SELECT&product_name&FROM&products&WHERE&id&=&1")-&fetch_object()-&product_&
print&$product_name;&//output&value
$mysqli-&close();
6.选择行数
//Open&a&new&connection&to&the&MySQL&server
$mysqli&=&new&mysqli('host','username','password','database_name');
//Output&any&connection&error
if&($mysqli-&connect_error)&{
&&&&die('Error&:&('.&$mysqli-&connect_errno&.')&'.&$mysqli-&connect_error);
//get&total&number&of&records
$results&=&$mysqli-&query("SELECT&COUNT(*)&FROM&users");
$get_total_rows&=&$results-&fetch_row();&//hold&total&records&in&variable
$mysqli-&close();
7.选择预处理
$search_product&=&"PD1001";&//product&id
//create&a&prepared&statement
$query&=&"SELECT&id,&product_code,&product_desc,&price&FROM&products&WHERE&product_code=?";
$statement&=&$mysqli-&prepare($query);
//bind&parameters&for&markers,&where&(s&=&string,&i&=&integer,&d&=&double,&&b&=&blob)
$statement-&bind_param('s',&$search_product);
//execute&query
$statement-&execute();
//bind&result&variables
$statement-&bind_result($id,&$product_code,&$product_desc,&$price);
print&'&table&border="1"&';
//fetch&records
while($statement-&fetch())&{
&&&&print&'&tr&';
&&&&print&'&td&'.$id.'&/td&';
&&&&print&'&td&'.$product_code.'&/td&';
&&&&print&'&td&'.$product_desc.'&/td&';
&&&&print&'&td&'.$price.'&/td&';
&&&&print&'&/tr&';
print&'&/table&';
//close&connection
$statement-&close();
$search_ID&=&1;&
$search_product&=&"PD1001";&
$query&=&"SELECT&id,&product_code,&product_desc,&price&FROM&products&WHERE&ID=?&AND&product_code=?";
$statement&=&$mysqli-&prepare($query);
$statement-&bind_param('is',&$search_ID,&$search_product);
$statement-&execute();
$statement-&bind_result($id,&$product_code,&$product_desc,&$price);
print&'&table&border="1"&';
while($statement-&fetch())&{
&&&&print&'&tr&';
&&&&print&'&td&'.$id.'&/td&';
&&&&print&'&td&'.$product_code.'&/td&';
&&&&print&'&td&'.$product_desc.'&/td&';
&&&&print&'&td&'.$price.'&/td&';
&&&&print&'&/tr&';
print&'&/table&';
//close&connection
$statement-&close();
8.插入数据库
//values&to&be&inserted&in&database&table
$product_code&=&'"'.$mysqli-&real_escape_string('P1234').'"';
$product_name&=&'"'.$mysqli-&real_escape_string('42&inch&TV').'"';
$product_price&=&'"'.$mysqli-&real_escape_string('600').'"';
//MySqli&Insert&Query
$insert_row&=&$mysqli-&query("INSERT&INTO&products&(product_code,&product_name,&price)&VALUES($product_code,&$product_name,&$product_price)");
if($insert_row){
&&&&print&'Success!&ID&of&last&inserted&record&is&:&'&.$mysqli-&insert_id&.'&br&/&';&
&&&&die('Error&:&('.&$mysqli-&errno&.')&'.&$mysqli-&error);
9.插入预处理
//values&to&be&inserted&in&database&table
$product_code&=&'P1234';
$product_name&=&'42&inch&TV';
$product_price&=&'600';
$query&=&"INSERT&INTO&products&(product_code,&product_name,&price)&VALUES(?,&?,&?)";
$statement&=&$mysqli-&prepare($query);
//bind&parameters&for&markers,&where&(s&=&string,&i&=&integer,&d&=&double,&&b&=&blob)
$statement-&bind_param('sss',&$product_code,&$product_name,&$product_price);
if($statement-&execute()){
&&&&print&'Success!&ID&of&last&inserted&record&is&:&'&.$statement-&insert_id&.'&br&/&';&
&&&&die('Error&:&('.&$mysqli-&errno&.')&'.&$mysqli-&error);
$statement-&close();
10.批量插入
//product&1
$product_code1&=&'"'.$mysqli-&real_escape_string('P1').'"';
$product_name1&=&'"'.$mysqli-&real_escape_string('Google&Nexus').'"';
$product_price1&=&'"'.$mysqli-&real_escape_string('149').'"';
//product&2
$product_code2&=&'"'.$mysqli-&real_escape_string('P2').'"';
$product_name2&=&'"'.$mysqli-&real_escape_string('Apple&iPad&2').'"';
$product_price2&=&'"'.$mysqli-&real_escape_string('217').'"';
//product&3
$product_code3&=&'"'.$mysqli-&real_escape_string('P3').'"';
$product_name3&=&'"'.$mysqli-&real_escape_string('Samsung&Galaxy&Note').'"';
$product_price3&=&'"'.$mysqli-&real_escape_string('259').'"';
//Insert&multiple&rows
$insert&=&$mysqli-&query("INSERT&INTO&products(product_code,&product_name,&price)&VALUES
($product_code1,&$product_name1,&$product_price1),
($product_code2,&$product_name2,&$product_price2),
($product_code3,&$product_name3,&$product_price3)");
if($insert){
&&&&//return&total&inserted&records&using&mysqli_affected_rows
&&&&print&'Success!&Total&'&.$mysqli-&affected_rows&.'&rows&added.&br&/&';&
&&&&die('Error&:&('.&$mysqli-&errno&.')&'.&$mysqli-&error);
11.更新删除
//MySqli&Update&Query
$results&=&$mysqli-&query("UPDATE&products&SET&product_name='52&inch&TV',&product_code='323343'&WHERE&ID=24");
//MySqli&Delete&Query
//$results&=&$mysqli-&query("DELETE&FROM&products&WHERE&ID=24");
if($results){
&&&&print&'Success!&record&updated&/&deleted';&
&&&&print&'Error&:&('.&$mysqli-&errno&.')&'.&$mysqli-&
$product_name&=&'52&inch&TV';
$product_code&=&'9879798';
$find_id&=&24;
$query&=&"UPDATE&products&SET&product_name=?,&product_code=?&WHERE&ID=?";
$statement&=&$mysqli-&prepare($query);
//bind&parameters&for&markers,&where&(s&=&string,&i&=&integer,&d&=&double,&&b&=&blob)
$results&=&&$statement-&bind_param('ssi',&$product_name,&$product_code,&$find_id);
if($results){
&&&&print&'Success!&record&updated';&
&&&&print&'Error&:&('.&$mysqli-&errno&.')&'.&$mysqli-&
//MySqli&Delete&Query
$results&=&$mysqli-&query("DELETE&FROM&products&WHERE&added_timestamp&&&(NOW()&-&INTERVAL&1&DAY)");
if($results){
&&&&print&'Success!&deleted&one&day&old&records';&
&&&&print&'Error&:&('.&$mysqli-&errno&.')&'.&$mysqli-&
亲们,如果有PHP相关的问题可以随时联系我们,
随笔分类(203)
随笔档案(227)
文章分类(1)
文章档案(1)
21ccvn提供国内423个城市的公交,铁路,航班,旅游,酒店,医院,教育等公共服务信息查询,致力于做国内最好的公共服务信息平台。
北京韦尔科技有限公司是一家从事互联网相关技术研发型的公司,对外提供互联网相关技术培训,产品研发等。
积分与排名
阅读排行榜
评论排行榜新手园地& & & 硬件问题Linux系统管理Linux网络问题Linux环境编程Linux桌面系统国产LinuxBSD& & & BSD文档中心AIX& & & 新手入门& & & AIX文档中心& & & 资源下载& & & Power高级应用& & & IBM存储AS400Solaris& & & Solaris文档中心HP-UX& & & HP文档中心SCO UNIX& & & SCO文档中心互操作专区IRIXTru64 UNIXMac OS X门户网站运维集群和高可用服务器应用监控和防护虚拟化技术架构设计行业应用和管理服务器及硬件技术& & & 服务器资源下载云计算& & & 云计算文档中心& & & 云计算业界& & & 云计算资源下载存储备份& & & 存储文档中心& & & 存储业界& & & 存储资源下载& & & Symantec技术交流区安全技术网络技术& & & 网络技术文档中心C/C++& & & GUI编程& & & Functional编程内核源码& & & 内核问题移动开发& & & 移动开发技术资料ShellPerlJava& & & Java文档中心PHP& & & php文档中心Python& & & Python文档中心RubyCPU与编译器嵌入式开发驱动开发Web开发VoIP开发技术MySQL& & & MySQL文档中心SybaseOraclePostgreSQLDB2Informix数据仓库与数据挖掘NoSQL技术IT业界新闻与评论IT职业生涯& & & 猎头招聘IT图书与评论& & & CU技术图书大系& & & Linux书友会二手交易下载共享Linux文档专区IT培训与认证& & & 培训交流& & & 认证培训清茶斋投资理财运动地带快乐数码摄影& & & 摄影器材& & & 摄影比赛专区IT爱车族旅游天下站务交流版主会议室博客SNS站务交流区CU活动专区& & & Power活动专区& & & 拍卖交流区频道交流区
UID空间积分0 积分3阅读权限10帖子精华可用积分3 信誉积分14 专家积分0 在线时间12 小时注册时间最后登录
白手起家, 积分 3, 距离下一级还需 197 积分
帖子主题精华可用积分3 信誉积分14 专家积分0 在线时间12 小时注册时间最后登录
论坛徽章:0
/bin/sh /home/php-5.5.30/ext/mysqli/libtool --mode=compile cc&&-I. -I/home/php-5.5.30/ext/mysqli -DPHP_ATOM_INC -I/home/php-5.5.30/ext/mysqli/include -I/home/php-5.5.30/ext/mysqli/main -I/home/php-5.5.30/ext/mysqli -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/usr/local/mysql/include/mysql&&-DHAVE_CONFIG_H&&-g -O2& &-c /home/php-5.5.30/ext/mysqli/mysqli.c -o mysqli.lo
cc -I. -I/home/php-5.5.30/ext/mysqli -DPHP_ATOM_INC -I/home/php-5.5.30/ext/mysqli/include -I/home/php-5.5.30/ext/mysqli/main -I/home/php-5.5.30/ext/mysqli -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/usr/local/mysql/include/mysql -DHAVE_CONFIG_H -g -O2 -c /home/php-5.5.30/ext/mysqli/mysqli.c&&-fPIC -DPIC -o .libs/mysqli.o
In file included from /usr/local/mysql/include/mysql/my_global.h:86,
& && && && && &&&from /home/php-5.5.30/ext/mysqli/php_mysqli_structs.h:63,
& && && && && &&&from /home/php-5.5.30/ext/mysqli/mysqli.c:34:
/usr/local/mysql/include/mysql/my_config.h:1173:1: warning: &PACKAGE_NAME& redefined
In file included from /home/php-5.5.30/ext/mysqli/mysqli.c:24:
/home/php-5.5.30/ext/mysqli/config.h:56:1: warning: this is the location of the previous definition
In file included from /usr/local/mysql/include/mysql/my_global.h:86,
& && && && && &&&from /home/php-5.5.30/ext/mysqli/php_mysqli_structs.h:63,
& && && && && &&&from /home/php-5.5.30/ext/mysqli/mysqli.c:34:
/usr/local/mysql/include/mysql/my_config.h:1176:1: warning: &PACKAGE_STRING& redefined
In file included from /home/php-5.5.30/ext/mysqli/mysqli.c:24:
/home/php-5.5.30/ext/mysqli/config.h:59:1: warning: this is the location of the previous definition
In file included from /usr/local/mysql/include/mysql/my_global.h:86,
& && && && && &&&from /home/php-5.5.30/ext/mysqli/php_mysqli_structs.h:63,
& && && && && &&&from /home/php-5.5.30/ext/mysqli/mysqli.c:34:
/usr/local/mysql/include/mysql/my_config.h:1179:1: warning: &PACKAGE_TARNAME& redefined
In file included from /home/php-5.5.30/ext/mysqli/mysqli.c:24:
/home/php-5.5.30/ext/mysqli/config.h:62:1: warning: this is the location of the previous definition
In file included from /usr/local/mysql/include/mysql/my_global.h:86,
& && && && && &&&from /home/php-5.5.30/ext/mysqli/php_mysqli_structs.h:63,
& && && && && &&&from /home/php-5.5.30/ext/mysqli/mysqli.c:34:
/usr/local/mysql/include/mysql/my_config.h:1182:1: warning: &PACKAGE_VERSION& redefined
In file included from /home/php-5.5.30/ext/mysqli/mysqli.c:24:
/home/php-5.5.30/ext/mysqli/config.h:65:1: warning: this is the location of the previous definition
/home/php-5.5.30/ext/mysqli/mysqli.c:321: error: expected ';', ',' or ')' before '*' token
/home/php-5.5.30/ext/mysqli/mysqli.c:364: error: expected ';', ',' or ')' before '*' token
/home/php-5.5.30/ext/mysqli/mysqli.c:413: error: expected ';', ',' or ')' before '*' token
/home/php-5.5.30/ext/mysqli/mysqli.c: In function 'mysqli_object_get_debug_info':
/home/php-5.5.30/ext/mysqli/mysqli.c:473: warning: assignment makes pointer from integer without a cast
/home/php-5.5.30/ext/mysqli/mysqli.c: In function 'zm_startup_mysqli':
/home/php-5.5.30/ext/mysqli/mysqli.c:624: error: 'mysqli_read_property' undeclared (first use in this function)
/home/php-5.5.30/ext/mysqli/mysqli.c:624: error: (Each undeclared identifier is reported only once
/home/php-5.5.30/ext/mysqli/mysqli.c:624: error: for each function it appears in.)
/home/php-5.5.30/ext/mysqli/mysqli.c:625: error: 'mysqli_write_property' undeclared (first use in this function)
/home/php-5.5.30/ext/mysqli/mysqli.c:627: error: 'mysqli_object_has_property' undeclared (first use in this function)
make: *** [mysqli.lo] Error 1
请问怎么解决 ,网上的方法都试过了,没用。
&&nbsp|&&nbsp&&nbsp|&&nbsp&&nbsp|&&nbsp&&nbsp|&&nbsp
UID空间积分0 积分4620阅读权限100帖子精华可用积分4620 信誉积分2912 专家积分0 在线时间3743 小时注册时间最后登录
帖子主题精华可用积分4620 信誉积分2912 专家积分0 在线时间3743 小时注册时间最后登录
认证徽章论坛徽章:12
可能没安装mysql的头文件(mysql-devel),安装这个(yum -y install mysql-devel)后再重试下。
UID空间积分0 积分3阅读权限10帖子精华可用积分3 信誉积分14 专家积分0 在线时间12 小时注册时间最后登录
白手起家, 积分 3, 距离下一级还需 197 积分
帖子主题精华可用积分3 信誉积分14 专家积分0 在线时间12 小时注册时间最后登录
论坛徽章:0
还是这样的错误,这个之前装过mysql-devel了, 各位大神都没碰到过么?&&
./configure --prefix=/usr/local/mysqli \
--with-php-config=/usr/local/php/bin/php-config \
--with-mysqli=/usr/local/mysql/bin/mysql_config&&
编译安装没有问题,提示是这样
。。。。。。
creating libtool
appending configuration tag &CXX& to libtool
configure: creating ./config.status
config.status: creating config.h
config.status: config.h is unchanged
UID空间积分0 积分4620阅读权限100帖子精华可用积分4620 信誉积分2912 专家积分0 在线时间3743 小时注册时间最后登录
帖子主题精华可用积分4620 信誉积分2912 专家积分0 在线时间3743 小时注册时间最后登录
认证徽章论坛徽章:12
本帖最后由 ccjsj1 于
10:37 编辑
没遇到过这样的问题,不能yum安装吗?
像是版本不兼容问题导致,介绍下系统版本、php版本、mysql版本、安装方法,看这边是否有环境试下。PHP程序员最常犯的11个MySQL错误 | 程序师mysqli_error
mysqli_error — Returns a string description of the last error
Procedural style:
string mysqli_error
( mysqli $link
Object oriented style (property)
string$error;
Returns the last error message for the most recent MySQLi function call
that can succeed or fail.
Procedural style only: A link identifier
returned by
A string that describes the error. An empty string if no error occurred.
Example#1 Object oriented style
&?php$mysqli&=&new&mysqli("localhost",&"my_user",&"my_password",&"world");/*&check&connection&*/if&(mysqli_connect_errno())&{&&&&printf("Connect&failed:&%s\n",&mysqli_connect_error());&&&&exit();}if&(!$mysqli-&query("SET&a=1"))&{&&&&printf("Errormessage:&%s\n",&$mysqli-&error);}/*&close&connection&*/$mysqli-&close();?&
Example#2 Procedural style
&?php$link&=&mysqli_connect("localhost",&"my_user",&"my_password",&"world");/*&check&connection&*/if&(mysqli_connect_errno())&{&&&&printf("Connect&failed:&%s\n",&mysqli_connect_error());&&&&exit();}if&(!mysqli_query($link,&"SET&a=1"))&{&&&&printf("Errormessage:&%s\n",&mysqli_error($link));}/*&close&connection&*/mysqli_close($link);?&
上例将输出:
Errormessage: Unknown system variable 'a'
There are no user contributed notes for this page.
is operated at:
Last updated: Tue Jul 26 01:41:43 2011 UTC13:09 提问
PHP配置问题(mysql_connect)报错
之前因为比较懒,就装了PHPnow,PHP版本是5.2,最近因为要学thinkPHP框架,由于用的是thinkPHP3.2,需要PHP5.3以上版本才能跑起来,就手动更新了PHP版本,更新到了5.3.5,并按照正常步骤配置了php.ini文件,打开了(extension_dir = "\ext"
extension=php_mysql.
extension=php_mysqli.)等模块,重启Apache,运行了一下之前写的练手项目,但只要和数据库连接有关的,都报了如下这个错误(Fatal error: Call to undefined function mysql_connect() in E:\php\htdocs\wangshangshudian\login.php on line 7),但是我都把php.ini相应和MySQL有关的模块都打开了,怎么还是这个问题呢,我就郁闷了,望各位大神帮忙看下是哪出错了,并且thinkPHP也出现了如下错误::(
系统不支持:mysql
FILE: E:\php\htdocs\demo\ThinkPHP\Library\Think\Db\Driver\Mysql.class.php  LINE: 27
#0 E:\php\htdocs\demo\ThinkPHP\Library\Think\Db\Driver\Mysql.class.php(27): E('???????????????...')
#1 E:\php\htdocs\demo\ThinkPHP\Library\Think\Db.class.php(90): Think\Db\Driver\Mysql-&construct(Array)
#2 E:\php\htdocs\demo\ThinkPHP\Library\Think\Db.class.php(65): Think\Db-&factory('')
#3 E:\php\htdocs\demo\ThinkPHP\Library\Think\Model.class.php(1287): Think\Db::getInstance('')
#4 E:\php\htdocs\demo\ThinkPHP\Library\Think\Model.class.php(95): Think\Model-&db(0, '', true)
#5 E:\php\htdocs\demo\ThinkPHP\Common\functions.php(554): Think\Model-&construct('user', '', '')
#6 E:\php\htdocs\demo\Application\Home\Controller\DBController.class.php(6): M('user')
#7 [internal function]: Home\Controller\DBController-&index()
#8 E:\php\htdocs\demo\ThinkPHP\Library\Think\App.class.php(155): ReflectionMethod-&invoke(Object(Home\Controller\DBController))
#9 E:\php\htdocs\demo\ThinkPHP\Library\Think\App.class.php(193): Think\App::exec()
#10 E:\php\htdocs\demo\ThinkPHP\Library\Think\Think.class.php(120): Think\App::run()
#11 E:\php\htdocs\demo\ThinkPHP\ThinkPHP.php(96): Think\Think::start()
#12 E:\php\htdocs\demo\index.php(24): require('E:\php\htdocs\d...')
#13 {main}
按赞数排序
重新重头再看了一遍安装的过程,自己发现了两处配置错误:
1.忘记将libmysql.dll至windows目录下的system32下
2.(最重要的错误)由于更新PHP版本之后,忘记修改了Apache文件下的conf下的http.conf中的PHPINDir "../",
将其PHPINDir的目录修改为更新后的PHP的版本目录,再重启Apache后,原来出现的这个错误(Fatal error: Call to undefined function mysql_connect() in E:\php\htdocs\wangshangshudian\login.php on line 7)不在出现了,连接MySQL数据库正常
194关注|507收录
358关注|1605收录
274关注|274收录
其他相似问题
相关参考资料

我要回帖

更多关于 mysqli mysql error 的文章

 

随机推荐