不能突然插入表格表

时间:2013-07-08 16:49:05

标签: php mysql database

我已经确认我正在使用以下内容:

$dbh=MYSQL_CONNECT(DB_HOST, DB_USER, DB_PASSWORD) OR _log("message.php: Can not connected to database.");

if (!$dbh)
{
$test = "Database is not connected.";
}
else{
$test = "All is not good. You're connected.";
}

<?php echo $test; ?>

我刚才注意到,当运行此文件时,它不再将给定值插入数据库表中。这是查询:

@mysql_select_db(DB_NAME) or _log("message.php:  Can not select database.");


$date=date("Y/m/d H:i:s");

$sql="insert into uploadedtovimeovideos set ifvisible='1', name ='$name', email='$email', occasion='$occasion', recipientName='$recipientName', recipientEmail='$recipientEmail', file='$file', subject='$subject', video='$fileName',msg='$msg', title='$msg', token='$token', date='$date', timezone='$timezone', datescheduled='$dateschedule', password='$password'";
$result = mysql_query($sql);

_log($sql);

此文件中的代码没有更改,但只是为了确定,我恢复了一个我知道肯定有效的旧版本,但它没有帮助。此外,我在将值插入其他表时没有任何问题。我查了一下,最后一次进入桌子的是昨天4点左右,但我不知道之后会发生什么。

是否只有一个表有任何常见问题?我应该寻找什么?

1 个答案:

答案 0 :(得分:0)

mysql_query上,尝试将or _log(mysql_error())功能附加到其中。

其次,您不应该使用任何mysql_*函数。相反,请使用mysqli_*或PDO。