Hi,
I am using HighScore to keep track on scores, I have added this sql data table:
CREATE TABLE `scores` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
`name` varchar(15) NOT NULL DEFAULT 'anonymous',
`score` int(10) UNSIGNED NOT NULL DEFAULT '0'
)
and this to call the HighScores:
<?php
include("common.php");
$link = dbConnect();
$limit = safe($_POST['limit']);
$query = "SELECT * FROM $dbName . `scores` ORDER by `score` DESC LIMIT $limit";
$result = mysql_query($query);
$my_err = mysql_error();
if($result === false || $my_err != '')
{
echo "
<pre>
$my_err
$query
</pre>";
die();
}
$num_results = mysql_num_rows($result);
for($i = 0; $i < $num_results; $i++)
{
$row = mysql_fetch_array($result);
echo $row['name'] . "\t - \t " . $row['score'] . "\n";
}
?>
but when I check in the browser I get the following error:
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 ‘’ at line 1
SELECT * FROM database_name . scores ORDER by score DESC LIMIT
Does anyone know why this is occurring?
Thanks in advance!