php +mysql 添加 删除 修改 insert into delete update

INSERT INTO 插入数据库

$sql = "INSERT INTO subject (uid,fun,title) VALUES (3,88,'语文')";
$query = mysql_query($sql, $link);
if($query){
    echo mysql_insert_id();
}

UPDATE SET 语法用于修改更新数据表中的数据

$sql="UPDATE subject SET title='英语',fun=60 WHERE id=3";

DELETE FROM 语法用于删除数据表的数据记录

$sql = "DELETE FROM user WHERE username = '小王'";

 

posted on 2015-11-27 10:31  小V_chen  阅读(378)  评论(0编辑  收藏  举报

导航