Unable to execute query (SELECT * FROM lb-players) in the database : 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 '-players' at line 1
I don't know why i am getting this error. All i can think of that is taking away lb from "lb-players" when you add a " - "?
[m]<?php
$conn = mysql_connect("23.23.23.23", "unknown", "itsAsecertxD");//ignore this xD
if (!$conn) {
echo "Unable to connect to the database : " . mysql_error();
exit;
}
if (!mysql_select_db("minecraft-rc")) {
echo "Unable to select database mydbname : " . mysql_error();
exit;
}
$sql = 'SELECT * FROM lb-players';
$result = mysql_query($sql);
if (!$result) {
echo "Unable to execute query ($sql) in the database : " . mysql_error();
exit;
}
if (mysql_num_rows($result) == 0) {
echo "No rows found, nothing to display.";
exit;
}
while ($row = mysql_fetch_assoc($result)) {
echo $row["playername"];
}
mysql_free_result($result);
?>[/m]
tell me if i posted this in the wrong place its been forever since i last been on this site :$