解决mysql_connect(): The mysql extension is deprecated and will beremoved in the future: use mysqli or

报错:mysql_connect(): The mysql extension is deprecated and will beremoved in the future: use mysqli or PDO instead

解决方案:将mysql_xxx 换成mysqli_xxx
需要注意的问题

<?php
$link = mysql_connect('localhost', 'user', 'password');
mysql_select_db('dbname', $link);

改成mysqi
<?php
$link = mysqli_connect('localhost', 'user', 'password', 'dbname');
<?php
//  老的
mysql_query('CREATE TEMPORARY TABLE `table`', $link);
// 新的
mysqli_query($link, 'CREATE TEMPORARY TABLE `table`');
已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 撸撸猫 设计师:C马雯娟 返回首页