感谢您花时间看这个。
没有错误弹出,但没有写入数据库。
有人可以帮我解决我做错了什么吗?
<?php
$subject = $_POST['subject'];
$comment = $_POST['comment'];
if(isset($_POST['submit']))
{
$connect = mysql_connect('localhost','<USER>','<PASSWORD>');
mysql_select_db("rebeler_comment");
$query = mysql_query("INSERT INTO `cdb` ('',subject', 'comment' VALUES ('',$subject','$comment')");
echo "Data successfully written to DB";
}
else{
echo "Sorry, there was a problem.";
}
?>