叮叮_dzp

welcome to dzp's blog!

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::


/**
* 对象的方式 写
*/
$mysqli = new mysqli(); //创建对象
$mysqli->connect('localhost','root','root','wx_new_shop','3307'); //链接数据库
$mysqli->set_charset('utf8'); // 中文乱码问题
$_result = $mysqli->query('SELECT * from wxshop_member where member_id = 6816146 '); // 查询
$_row = $_result->fetch_assoc(); // 数组显示
$_result = $mysqli->query('update wxshop_member SET member_user_id = 11 WHERE member_id = 6816146'); // 更新

// 以过程的方式写
$con = mysqli_connect('localhost','root','root','wx_new_shop','3307');
mysqli_set_charset($con, 'utf8');
$query = mysqli_query($con, 'SELECT * from wxshop_member where member_id = 6816146 ');
$_result = mysqli_fetch_assoc($query);

echo "<pre>";
var_dump($_result);

posted on 2018-02-08 15:28  叮叮_dzp  阅读(199)  评论(0编辑  收藏  举报