多重查询
来源:互联网 发布:天下大乱知乎 编辑:程序博客网 时间:2024/04/29 08:36
//连接数据库product 数据表product
//mysqli---连接对象
//mysqli_result---select结果集对象
//mysqli_stmt ---预处理对象
//第一步:连接数据库 mysqli
$mysqli = new mysqli("localhost","root","","product");
//mysqli_init();----不连接任何数据库情况下产生一个对象
//mysqli->query("set names utf8");
//第二步:mysqli_result
//$result = $mysqli->query("select * from product");
//insert update delete
//insert into product values().....;
//显示影响的行数、该字段的名称、指针在第几个列、字符串最大的长度?
//三个对象
//显示客户端版本
echo $mysqli->get_client_info();
echo "<br>";
//echo $mysqli->get_host_info();
echo $mysqli->get_server_info();
echo "<br>";
//执行多个查询
//multi_query more_result next_result
//store_result(将完整的结果集存储) user_result(表示开始使用结果集)
//每条语句后用:作为分隔符
$sql = "set names utf8;select name from product;select price from product";
$res = $mysqli->multi_query($sql);
print_r($res);
echo "<br>";
$more = $mysqli->more_results();
print_r($more);
echo "<br>";
$next = $mysqli->next_result();
print_r($next);
echo "<br>";
//if($mysqli->multi_query($sql)){
//$res2 = $mysqli->store_result();
//$row = $res2->fetch_row();
//print_r($row);
//}
//$result = $mysqli->store_result();
//print_r($result);
echo $mysqli_affected_rows;
?>
- 多重查询
- 关键词:ASP 多重查询
- mongoDB 多重数组查询
- mysql 多重查询
- 多重查询SQL语句解决方案及代码
- grails中多重查询及其显示方法
- 最简洁的多重查询的解决方案
- 数据库相关 多重查询 导入 新建 数据表
- 数据多重完整嵌套查询语句
- Rails中多重子表多条件查询
- qt sql多重条件查询简便方法
- ASP实现最简洁的多重查询的解决方案
- 关于mysql多重组合查询的一点技巧总结
- mongoDB 多重数组查询 AngularJS绑定显示 nodejs
- Oracle数据库多重子查询嵌套的坑
- SQL2000数据库查询讲解008--查询满足条件的元组05:多重条件查询
- 使用resultMap实现ibatis复合数据结构查询(1.多重属性查询;2.属性中含有列表查询)
- 多重继承
- JAVA同步设计的原则
- Hello World!
- listView分页(带图片)
- USACO Section 1.4 Mother's Milk - 输出错了好几次..
- 分布式文件系统元数据服务模型
- 多重查询
- 剖析Windows消息处理机制
- jfreechar 曲线图
- linux 服务器 yum首先需要安装的必备软件
- 有关选中listView中一行,在特定窗口中显示相应信息的两个事件说明
- listview选中行字体变大
- KMP算法详解
- 关于通过ListView将数据绑定到复选框的问题的总结
- Java多线程编程总结