だから、私は一日中このコードと戦ってきました。私はたくさんのことを試しましたが、役に立ちませんでした。だから答えを求めてここに来る。
編集:コメントに記載されている問題のいくつかを修正しました。それでも、問題は解決しません。エラーは次のとおりです。
You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near
'values where `item_id` = 'Throne' ORDER BY `timestamp` DESC LIMIT 10'
at line 1
これは私のPHPコードです:
include("config.php");
include("functions.php");
if(isset($_GET['name'])){
$id = mysql_real_escape_string($_GET['name']);
$get_rares = mysql_query("SELECT * FROM rares WHERE `name` = '".$id."'") or die(mysql_error());
$rare = mysql_fetch_array($get_rares);
if(mysql_num_rows($check) == 0){
echo 'The rare '.$id.' doesn\'t exist!<br>';
}else{
$r = mysql_fetch_array($check);
$ids = $r["id"];
$name = $r["name"];
$value = $r["value"];
$lastedited = $r["lastedited"];
$catid = $r["catid"];
$desc = $r["desc"];
$image = $r["image"];
$big_image = $r["big_image"];
$release_value = $r["release_value"];
$releasedate = $r["releasedate"];
}
}else{
echo 'No rare has been selected to view.<br><br>Click <a href="members.php">here</a> to go to the rare list.';
}
?>
<?php $values = mysql_query("SELECT * FROM values where `item_id` = '".$id."' ORDER BY timestamp DESC LIMIT 10") or die(mysql_error());