5.php内置MySQL函数学习
来源:互联网 发布:长门号战列舰模型淘宝 编辑:程序博客网 时间:2024/05/18 13:04
函数功能例子mysql_connect()连接mysqlmysql_connect('localhost','root','123');mysql_close()关闭非持久的 MySQL 连接mysql_close($con);mysql_select_db()连接数据库mysql_select_db('info');mysql_query()执行sql语句/设置字体
mysql_query('set names utf8');
mysql_query('insert into test (name) values ("abc")');
mysql_error()检查上一个语句错误 mysql_insert_id()在mysql中,执行插入语句后,可得到自增的id
$uid=mysql_insert_id();四fetch函数 mysql_fetch_row()每次执行取出一条数据,该数据为"索引数组"$arr=mysql_fecth_row($query);mysql_fetch_array()每次执行取出一条数据,该数据为"索引数组"和"关联数组"$arr=mysql_fecth_array($query);
$arr=mysql_fecth_array($query,MYSQL_ASSOC);//索引
$arr=mysql_fecth_array($query,MYSQL_NUM);//关联
mysql_fetch_assoc()mysql_fetch_assoc 返回是关联数组,必须通过字段名来取值$arr=mysql_fecth_assoc($query); $arr['name'];mysql_fetch_object()mysql_fetch_object 返回的是对象,取值方式为 $data->title$arr=mysql_fecth_object($query); $arr->name 0 0
- 5.php内置MySQL函数学习
- PHP学习笔记六之MySQL内置函数
- 常用php内置MySQL函数
- Mysql学习之内置函数
- php内置Mysql函数(1)
- php内置Mysql函数(2)
- php内置mysql函数(3)
- PHP模板学习--Smarty 内置函数
- MySQL学习笔记_7_MySQL常用内置函数
- mysql学习-数据库内置日期函数
- MySQL学习笔记_7_MySQL常用内置函数
- php学习收集--几个实用的PHP内置函数使用指南
- php深入学习笔记二( 函数内置函数 )
- Smarty实例教程----实例篇(一、使用PHP内置MYSQL函数)
- PHP数组内置函数
- php内置函数
- PHP基本内置函数
- php内置函数number_format
- 坚持刷题
- 2.5习题与注解
- ActionResult
- Search in Rotated Sorted Array II - Leetcode
- 我的学习之旅(37) sched.c
- 5.php内置MySQL函数学习
- HttpStatus 404
- jstl/jsp--el 判断为空
- 验证字符串是否为有效的IP地址
- 素数筛
- sap权限维护操作手册
- Android下添加新的自定义键值和按键处理流程
- VLAN\VTP\HSRP综合实验(真机测试通过)
- 关于客户端与服务端时区不同导致客户端上的时间不准问题的解决方案