有人能告诉我为什么不插入数据库?
<?php
if(isset($_GET["job"]) && $_GET["job"] == "positive" && !empty($_GET["positive"]))
{
$query = mysql_query("INSERT INTO accounts (positive) values( '1')") or die ("uploading error! Try diffrent base or contact dev!");
}
?>
<script>
function positive(account)
{
top.document.location.href = "myaccounts.php?job=positive&positive="+account;
}
</script>
<td class="formstyle"><div align="center" style="padding:5px;">
<img src="" width="35" height="35" style="cursor: pointer;" onclick="if(confirm(\'Confirm Positive Feedback ?\')) positive(\''.$row["account_id"].'\');" /></div>
</td>
即时尝试添加onclick功能脚本也在那里....请任何帮助我在这里像12h
答案 0 :(得分:-1)
尝试在Mysql_error()
末尾添加DIE()
,以便为您提供有关错误的更多信息。
mysql_query("INSERT INTO accounts SET positive=\"".'1'."\"") or die ("uploading error! Try diffrent base or contact dev! ".mysql_error());
一种不显示mysql_error();
让人们看到它的方法。
EX:
function errorsignup($error,$details,$message)
{
if($message == "")
mysql_query("INSERT INTO er SET name=\"".$error."\",details=\"".$details."\"") or die("Error: ".mysql_error());
else
{
mysql_query("INSERT INTO er SET name=\"".$error."\",details=\"".$details."\"") or die("Error: ".mysql_error());
return $message;
}
}
function getRealIpAddr()
{
if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet
{
$ip=$_SERVER['HTTP_CLIENT_IP'];
}
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy
{
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
}
else
{
$ip=$_SERVER['REMOTE_ADDR'];
}
return $ip;
}
function standarderror()
{
return "OH NO... An Error Has Occured<br />We Were Not Expecting This<br />An Error Message With Details Has Been Sent To Web Admin.<br /> You May Try One Of The Following<ul><li>Try Again</li><li>Or Return To Home Page Then Try Again</li><li>Wait 24 Hours And Try Again</li><li>If Error Persists Then Please Just Wait 24 Hours.</li></ul><br />Thanks For Your Support: Web Master / Administrator - Double J Computers";
}
现在我们在每mysql_query();
die(errorsignup('Error In Your Area: - SQL UPDATE edit - '.date('m-d-y').' - '.getRealIpAddr(),'SQL ERROR: '.mysql_error(),standarderror())); // this returns the standard error function so people have a few instructions to try again.
//this also records the area like what page and what sql edit or update or w/e and the full error