0
我笨2.2版本和 PHP版本5.5.16-1 + deb.sury.org〜可信赖+ 1 和 MySQL客户端API版本38年5月5日 我得到错误:MySQL扩展被弃用笨2.2
Message: mysql_insert_id(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead
但在我的application/config/database.php中 'mysqli的' 设置:
$db['default']['dbdriver'] = 'mysqli';
$db['default']['dbprefix'] = 'bp_';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
有什么不对?这是PDO有效的格式和包有我从我的
# apt-cache search pdo
ifupdown - high level tools to configure network interfaces
php5-mysql - MySQL module for php5
php5-odbc - ODBC module for php5
php5-pgsql - PostgreSQL module for php5
php5-sqlite - SQLite module for php5
gap-gapdoc - GAPDoc meta package for GAP documentation
guessnet - Guess which LAN a network device is connected to
ifupdown-extra - Network scripts for ifupdown
ifupdown-multi - multiple default gateway support for ifupdown
ifupdown-scripts-zg2 - Zugschlus' interface scripts for ifupdown's manual method
irssi-scripts - collection of scripts for irssi
libjnlp-servlet-java - simple and convenient packaging format for JNLP applications
mediawiki-extensions-base - Extensions for MediaWiki -- Base package
netscript-2.4 - Linux 2.4/2.6 router/firewall/VM host network config. system.
netscript-2.4-upstart - Linux 2.4/2.6 router/firewall/VM host network config. system.
pd-pdogg - collection of Ogg/Vorbis objects for Pd
php-apigen - API documentation generator for PHP 5.3+
php-db - PHP PEAR Database Abstraction Layer
php-mdb2 - merge of the PEAR DB and Metabase php database abstraction layers
php-phpdocx - dynamical generation of .docx files
php-structures-datagrid - Render a data table with automatic pagination and sorting
php5-mysqlnd - MySQL module for php5 (Native Driver)
php5-mysqlnd-ms - MySQL replication and load balancing module for PHP
php5-sybase - Sybase/MS SQL Server module for php5
python-setupdocs - setuptools plugin that automates building of docs from reST source
python-sphinxcontrib-httpdomain - Sphinx domain for HTTP APIs
python-sphinxcontrib.phpdomain - Sphinx "phpdomain" extension
sheepdog - distributed storage system for QEMU
可能可以在你的代码中,其中“mysql_insert_id()”是静态的书面所以搜索并更改为“mysqli_insert_id()” – rahul 2014-08-28 05:35:31
是,似乎mysqli_insert_id()是决定,但它需要$ link参数?我怎样才能在模型中得到它,因为我没有手动创建mysql链接? – mstdmstd 2014-08-28 11:16:43