我是这个站点的新手-请温柔一点:
本地主机上的 P mySQL 数据库适用于插入语句,但是一旦我将数据库连接更改为服务器连接,它就会给我错误:错误代码 1146:1146 没有任何错误描述. 可能是什么原因?
根据我的错误捕获逻辑,连接一直成功到查询运行的部分。在本地版本上,它就像一个魅力。有任何想法吗?
:::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::
if($errors == 0)
{
$DBConnect = @mysql_connect("db.start.ca", "nokeekwe", "classifiedlol");
if($DBConnect === FALSE)
{
echo "<p>Unable to connect. " .
"Error code " . mysql_errno() . ": " .
mysql_error() . "</p>\n";
$errors++;
}
else
{
$DBName = "nokeekwe";
$result = @mysql_select_db($DBName, $DBConnect);
if($result === FALSE)
{
echo "<p>Unable to select DB. " .
"Error code " . mysql_errno($DBConnect) .
": " . mysql_error($DBConnect) .
"</p>\n";
$errors++;
}
}
}
if($errors > 0)
{
echo "<p>Please use your browser's BACK button" .
" to return to the form and fix your errors.</p>\n";
}
if($errors == 0)
{
$title = stripslashes($_POST['title']);
$desc = stripslashes($_POST['desc']);
$req = stripslashes($_POST['req']);
$employer = stripslashes($_POST['employer']);
$phone = stripslashes($_POST['phone']);
$fax = stripslashes($_POST['fax']);
$email = stripslashes($_POST['email']);
$address = stripslashes($_POST['address']);
$insertJob = "INSERT INTO tbljobs (jobTitle, jobDesc, jobReq, jobEmployer, jobPhone, jobFax, jobEmail, jobAddress) VALUES ('$title', '$desc', '$req', '$employer', '$phone', '$fax', '$email', '$address')";
$QueryResult = mysql_query($insertJob, $DBConnect); // Run the Query Now woohoo.
if($QueryResult === FALSE)
{
echo "<p>Unable to save your job. " .
" Error code " .
mysql_errno($DBConnect) . ": " .
mysql_errno($DBConnect) . "</p>\n";
//echo $insertJob;
$errors++;
}
else
{
echo "Job Lead Saved!";}
mysql_close($DBConnect);
}
非常感谢