怎么连接数据库

来源:互联网 发布:截面数据用什么模型 编辑:程序博客网 时间:2024/05/01 14:00
mysql_connect('105.113.14','root','root') or die("error connecting") ; 
//连接数据库  
mysql_query("set names 'utf8'");
//数据库输出编码 应该与你的数据库编码保持一致.
mysql_select_db('xgxad'); 
//打开数据库 
    //update MyClass set name='Mary' where id=1;
    $sql = "update xgx_fb set question='nihao' where id='199'";
    mysql_query($sql);
0 0
原创粉丝点击