Home > Backend Development > PHP Tutorial > yii框架,增删节查,sql

yii框架,增删节查,sql

WBOY
Release: 2016-06-13 12:46:33
Original
883 people have browsed it

yii框架,增删改查,sql
1.$sql= "insert into tbl_user(`id`,`username`,`password`)values(null,'alu','123');
2.$sql= "select * from tbl_user where id=1;
3.$sql= "update tbl_user set password="123456" where id=6";
4.$sql= "delete from tbl_user where id=6;";
//设置字符编码
mysql_query("set names utf8");
$result=mysql_query($sql) or die('sql语句错误,系统给的提示是:'.mysql_error());

5.$num = mysql_num_rows($result)以及$num=mysql_fetch_array($result);
以上语句在yii框架里面应该怎样写?[/color][/color]

SQL Yii 数据的增删改查 框架
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template