主题:请教数据库问题(n) 谢谢
我做了一个简易信箱,类似留言板,里面有一个输入信息的textrear和2个按钮,$who
取值和插入语句部分如下,运行后显示:
程序错误:No1054
Unknown column 'ss' in 'field list'
如果把$who处改为字符串,则显示$text输入的字符串错误No1054,
也就是说,value中不能写$who、$text,这2处只能写常量,但$week和$time可以,
请问错误在哪里?谢谢!
switch ($_POST["submit"])
{
case "submit1":
$who="ss";
break;
case "submit2":
$who="mm";
}
$query="INSERT INTO xin (week,submit,text,time) VALUE($week,$who,$text,$time)";
$result=mysql_query($query);
取值和插入语句部分如下,运行后显示:
程序错误:No1054
Unknown column 'ss' in 'field list'
如果把$who处改为字符串,则显示$text输入的字符串错误No1054,
也就是说,value中不能写$who、$text,这2处只能写常量,但$week和$time可以,
请问错误在哪里?谢谢!
switch ($_POST["submit"])
{
case "submit1":
$who="ss";
break;
case "submit2":
$who="mm";
}
$query="INSERT INTO xin (week,submit,text,time) VALUE($week,$who,$text,$time)";
$result=mysql_query($query);