Aliases and deprecated Mysqli Functions
Table of Contents
- mysqli_bind_param — Alias for mysqli_stmt_bind_param
- mysqli_bind_result — Alias for mysqli_stmt_bind_result
- mysqli_client_encoding — Alias of mysqli_character_set_name
- mysqli_connect — Alias of mysqli::__construct
- mysqli::disable_reads_from_master — Disable reads from master
- mysqli_disable_rpl_parse — Disable RPL parse
- mysqli_enable_reads_from_master — Enable reads from master
- mysqli_enable_rpl_parse — Enable RPL parse
- mysqli_escape_string — Alias of mysqli_real_escape_string
- mysqli_execute — Alias for mysqli_stmt_execute
- mysqli_fetch — Alias for mysqli_stmt_fetch
- mysqli_get_cache_stats — Returns client Zval cache statistics
- mysqli_get_metadata — Alias for mysqli_stmt_result_metadata
- mysqli_master_query — Enforce execution of a query on the master in a master/slave setup
- mysqli_param_count — Alias for mysqli_stmt_param_count
- mysqli_report — Alias of of mysqli_driver->report_mode
- mysqli_rpl_parse_enabled — Check if RPL parse is enabled
- mysqli_rpl_probe — RPL probe
- mysqli_send_long_data — Alias for mysqli_stmt_send_long_data
- mysqli::set_opt — Alias of mysqli_options
- mysqli_slave_query — Force execution of a query on a slave in a master/slave setup
- PHP Руководство
- Функции по категориям
- Индекс функций
- Справочник функций
- Расширения для работы с базами данных
- Расширения для работы с базами данных отдельных производителей
- MySQL Drivers and Plugins
- Введение
- Краткий обзор
- Краткое руководство
- Установка и настройка
- Расширение mysqli и постоянные соединения
- Предопределенные константы
- Notes
- Основная информация о функциях расширения MySQLi
- Examples
- Класс mysqli
- The mysqli_stmt class
- The mysqli_result class
- Класс mysqli_driver
- Класс mysqli_warning
- The mysqli_sql_exception class
- Синонимы и устаревшие Функции Mysqli
- Список изменений
Коментарии
I tryed Marco Kaiser's way of getting both mysql_* and mysqli_*, but it failed for me. However I could get it working this way:
First of all I installed the MySQL 4.1.3 binary disribution acourding to the manual. Then I simply passed these ./configure arguments:
--with-mysql=/path/to/mysql4.1.3
--with-mysqli=/path/to/mysql4.1.3/bin/mysql_config
This enabled both, the mysql_* and mysqli_* functions.
Severin Kacianka
If you want to build php with both the Mysql and mysqli extensions, make sure your mysql distribution comes with shared libraries or build mysql yourself with shared libraries. With only static mysql libraries the compile process will fail.
I successed to install php support for a mysql 4.1.7 database after several attempts because the instructions are not clear.
I have a server with linux SuSe 9 enterprise with apache 1.3.31. I installed mysql from rpm files, i installed php 4.3.9 as dynamic library. this version database needs its own client library else the mysql functions in php will not work.
configuration must be as following:
./configure --with-msqli=/usr/bin/mysql_config --with-mysql=/usr --with-apxs=/usr/local/apache/bin/apxs
Must be installed in your machine the correct mysql librery:
MySQL-devel-4.1.7-0
MySQL-shared-4.1.7-0
For those having trouble compiling with both --with-mysql AND --with-mysqli, I found a solution at this URL:
http://bugs.php.net/bug.php?id=29860&edit=1
rjanson at msn dot com writes:
OK, finally an answer!
I checked Makefile and found the following line:
EXTRA_LIBS = -lcrypt -lcrypt -lmysqlclient -lpng -lz -lz -lresolv -lm
-ldl -lnsl -lxml2 -
lz -lm -lxml2 -lz -lm -lmysqlclient -lcrypt -lnsl -lm -lz -lnss_files
-lnss_dns -lresolv -lnss_files
-lnss_dns -lresolv -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lcrypt
By removing one of the -lmysqlclient entries on this line I was able to
successfully make and make install with both mysql and mysqli. As
confirmed by phpInfo().
I'm not sure why the other libs have multiple entries and don't cause
make to crash.
I have spent far too much time finding this answer:
Since PHP5 many many people are having installation problems. I found many apps were broken when I upgraded to version 5. I tried to install mysql and mysqli and had problems.
Here's the solution:
After doing:
./configure --with-mysql=/path/to/mysql_config --with-mysqli=/path/to/mysql_config
do this:
"
if you want to use both the old mysql and the new mysqli interface, load the Makefile into your editor and search for the line beginning with EXTRA_LIBS; it includes -lmysqlclient twice; remove the second instance
"
then you can:
make
make install
......
Please note: the mysql-dev must be installed or you won't have a mysql_config anywhere. I installed the mysql-dev rpm
Further note: the information about the Makefile's duplicate instances of "-libmysqlclient" came from Michael Kofler. Thanks should be directed to him. He gives more details at the following link:
http://www.kofler.cc/forum/forumthread.php?rootID=3571
For those having trouble getting MySQLi to work, there is another way that is set to become much more common:
http://dev.mysql.com/downloads/connector/php-mysqlnd/
This is the new MySQL native driver which has been backported from PHP6 and replaces MySQLi with a version that doesn't require any local MySQL client libraries or binaries.
I had a problem compiling PHP 5.2.5 with mysqli enabled on Mac OS X. Whether this problem was unique to me I do not no, so I am posting this for anybody else that runs into the same problem. Configure would run right to the end, but I had it telling me something had failed and that it was likely messed up. Upon checking debug.log I noticed this:
dyld: Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib
Referenced from: /Users/daniel/desktop/php -5.2.5/sapi/cli/php
Reason: image not found
/bin/sh: line 1: /Users/daniel/desktop/php -5.2.5/tmp-php.ini: Permission denied
dyld: Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib
Referenced from: /Users/daniel/desktop/php -5.2.5/sapi/cli/php
Reason: image not found
make: [test] Error 133 (ignored)
After screwing around for an hour and screaming many profanities at my computer I looked back at the error and noticed:
"/usr/local/mysql/lib/<b>mysql/</b>libmysqlclient.15.dylib
Why it was using this path I do not know, but I headslapped when I realised how simple it was! I solved the problem by creating a link called mysql that linked back on itself:
cd /usr/local/mysql/lib
sudo ln -s ./ mysql
Problem solved! I probably should have figured out why it was doing this instead, but this was easier and saved me from allot more frustration.
If you need to install mysqli extension there is no need to recompile PHP5 pr PHP5-fpm...
apt-get install php5-mysqlnd
Will install mysql and mysqli and mysqlnd
If you compile PHP from source then yes add the -use-mysqli in compile config.
This is Debian and Ubuntu. Or at least Ubuntu.