$hostname
=
"localhost"
;
$username
=
"root"
;
$password
=
""
;
$link
=mysql_connect(
$hostname
,
$username
,
$password
);
mysql_select_db(
"test"
,
$link
);
$sql_str
=
"update friends set name='andy' where id=1"
;
mysql_query(
$sql_str
)
or
die
(
"出现错误!"
);
echo
mysql_info(
$link
);
$sql_str
=
"insert into friends(name,sex,birthday,address)values('陈靖仇','男','593-08-23','天之痕')"
;
mysql_query(
$sql_str
)
or
die
(
"出现错误!"
);
printf(
"最后一次插入操作的id值为:%dn"
,mysql_insert_id());