为什么数据库只能读不能写
yqdfr 2004-07-13 10:18:05 <?
$myconn=mysql_connect("localhost","root","");
mysql_select_db("test",$myconn);
$strSql="select * from reguser";
$result=mysql_query($strSql,$myconn);
while($row=mysql_fetch_array($result))
{
?>
用上面的语句读数据库成功。
但用下面的语句就不能写于数据库,
<?
$myconn=mysql_connect("localhost","root","");
mysql_select_db("test",$myconn);
$strSql="insert into reguser(userid,sex,age,tel,email,address)
values('$userid','$sex','$age','$tel','$email','$address')";
$result=mysql_query($strSql,$myconn) or die(mysql_error());
mysql_close($myconn);
?>
我用的是linux系统,请大家指点!