<?php//連接數(shù)據(jù)庫(kù)mysql_connect('127.0.0.1', 'code1', '');mysql_select_db('code1');mysql_query("set names 'utf8'");//預(yù)設(shè)數(shù)據(jù)以便進(jìn)行更新操作mysql_query("insert into user(name, age, class) values('王二', 19, '高三五班')");$id = mysql_insert_id();//在這里更新id為$id的行的名字為李白//輸出更新數(shù)據(jù)條數(shù)echo '數(shù)據(jù)更新行數(shù):'.mysql_affected_rows();mysql_query("delete from user where id='$id'");
php題目誰(shuí)會(huì)做?
AREYOUHACKER
2017-04-17 19:54:22