<?php
$conn=mysql_connect("localhost","root","root");
mysql_select_db("db",$conn);
mysql_query("set names gb2312");
?>
<wbr></wbr>?>
PHP连接MySQL数据库示例
本文展示了一个使用PHP连接MySQL数据库的基本示例代码。通过设置数据库连接参数,并选择指定的数据库,最后设置字符集为gb2312,确保了中文字符能够正确显示。
4375

被折叠的 条评论
为什么被折叠?