从php5.6开始已经不支持mysql_connect进行连接mysql数据库,下面聊下通过自行编译安装mysql扩展支持mysql_connect方法操作数据库 1:获取PHP MySQL扩展源码 git clone https://github.com/php/pecl-database-mysql mysql --recursive 2:编译 cd到mysql目录,执行命令:phpize ./configure –with-php-config=/www/server/...
我已经在本地主机和实时服务器上安装了cre Loaded 6.4.1 在本地主机上,我在管理面板中遇到错误 Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in C:\xampp\htdocs\osc\admin\includes\functions\database.php on line 19 ...
$conn = mysql_connect("localhost", "user", "password"); mysql_select_db("database"); // 执行 SQL 查询 $type = $_POST['type']; $sql = "SELECT * FROM `table` WHERE `type` = {$type}"; $result = mysql_query($sql); // 打印结果 while($row = mysql_fetch_array($result, MY...