由买买提看人间百态

topics

全部话题 - 话题: mysqli
(共0页)
d******8
发帖数: 2191
1
来自主题: BuildingWeb版 - PHP mysqli的too many connections的问题
出错信息贴在下面,有个foreach循环不停的从数据库取数据,第0-12次都成功了(输
出表示正常),但是第13次挂掉了。几天前还可以的,现在突然不行了,这几天没有配
置mysql,请问怎么办?谢谢!
0
1
2
3
4
5
6
7
8
9
10
11
12
PHP Warning: mysqli::mysqli(): (08004/1040): Too many connections in /var/
www/2014/GrabberClass.php on line 89
PHP Warning: mysqli::prepare(): Couldn't fetch mysqli in /var/www/2014/
GrabberClass.php on line 90
PHP Fatal error: Call to a member function bind_param() on a non-object in
/var/www/2014/GrabberClass.php on line 91
b*******l
发帖数: 1737
2
来自主题: BuildingWeb版 - error in connecting PHP with MySQL
Thanks, easywebx. That's it. I was wondering why the default php.ini
commented out all these extensions.
The function is available now. However, I still cannot connect to the
database. Below is my code:
ini_set('display_errors', true);
error_reporting(E_ALL);
$mysqli = new mysqli("localhost", "john", "abc123", "test");
If (1 > 0) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
} else {
printf("Host information: %s\n", mysqli_get_host_info($mysqli));
mysqli
k*******p
发帖数: 8821
3
问一个问题,包子奉上給有用的解决办法。
有一段小代码,是在一个表Customer_table查询Customer_ID.如果这个id 存在则输出"
good",否则输出"bad".'gooduser'这个id是表中存在的,执行代码的结果是输出“good
"。假如我把$uid换成一个不存在的id,比如$uid='bdxhsbfhbfhc';结果还是输出"good"
.我如果新建一个php文件,初始一个不存在的id, $uid='bdxhsbfhbfhc';输出“bad".
我如果把$uid换成一个存在的id,比如$uid='gooduser',结果还是“bad".也就是第一
次的结果永远存下来了。这是为什么呢?
$mysqli = mysqli_connect("localhost", "root", "abcde", "table1");
if (mysqli_connect_errno()) {
printf("Connect failed: %sn", mysqli_connect_error());
exit();
}
else {
... 阅读全帖
b*******l
发帖数: 1737
4
来自主题: BuildingWeb版 - error in connecting PHP with MySQL
Hello all,
I am new to PHP and MySQL programming, and I am trying to connect to MySQL
via my PHP script. My PHP scripts generally work. However, for the following
PHP code:
ini_set('display_errors', true);
error_reporting(E_ALL);
$mysqli = mysqli_connect("localhost", "xxx", "xxx", "test");
...................
?>
I get the following error message:
Fatal error: Call to undefined function mysqli_connect() in C:\Program Files
\Apache Group\Apache2\htdocs\simpleconnection.php on line 6
Can some
j*****o
发帖数: 320
5
来自主题: BuildingWeb版 - error in connecting PHP with MySQL
This is PHP5 only. Maybe your host supports PHP4 by default? If so, you
may need a htaccess file to enable PHP5.

Hello all,
I am new to PHP and MySQL programming, and I am trying to connect to MySQL
via my PHP script. My PHP scripts generally work. However, for the following
PHP code:
ini_set('display_errors', true);
error_reporting(E_ALL);
$mysqli = mysqli_connect("localhost", "xxx", "xxx", "test");
...................
?>
I get the following error message:
Fatal error: Call to undefined
e******x
发帖数: 925
6
来自主题: BuildingWeb版 - error in connecting PHP with MySQL
试试: $mysqli = mysqli_connect("localhost", "john", "abc123", "test");
或者先用root用户试试。
a*******t
发帖数: 85
7
We have all common php extensions ready other than imagemagick.
for example:
bz2, curl, gd, ldap, libxml, mbstring, mcript, memcache, mysql, mysqli,
odbc, openssl, pcre, sqlite, zip, zlib....
d******8
发帖数: 2191
8
来自主题: BuildingWeb版 - 如何存储用户提交的表格
mysql
php class is mysqli

,
g****z
发帖数: 1135
9
来自主题: BuildingWeb版 - PHP mysqli的too many connections的问题
写个connection pooling就是了, 不难。
d******8
发帖数: 2191
10
来自主题: BuildingWeb版 - PHP mysqli的too many connections的问题
刚刚发现,原来某个函数调用进入了死循环,谢谢!
p*****u
发帖数: 214
11
来自主题: BuildingWeb版 - PHP mysqli的too many connections的问题
你这也忒牛了,至少给MySQL能够有一个等待时间吧! 否则整个的链接资源被你占满,
如果我是管理员肯定要限制你的连接数!
c**t
发帖数: 2744
12
没有RH Subscription,不能加repo,只好从源码编译PHP。
./configure --prefix=/usr/local --with-pdo-mysql --with-libdir=lib64 --
libdir=/usr/lib64 --enable-bcmath --enable-calendar --enable-exif --enable-
ftp --enable-mbstring --enable-soap --enable-zip --with-curl --with-freetype
-dir --with-gettext --with-iconv --with-jpeg-dir --with-kerberos --with-
mhash --with-mysql --with-mysqli --with-openssl --with-png-dir --with-regex
--with-xmlrpc --with-xsl --with-zlib-dir --with-config-file-path=/usr/local/
lib --with... 阅读全帖
(共0页)