Well I haven't used mysql in a looong time and finally now the need arises I'm face to face with an extremely simple problem that I am unable to solve.
This is the segment of code I'm having trouble with--
$result = mysql_query("SELECT online, total FROM check WHERE id = '$a'") or die(mysql_error());
$row = mysql_fetch_array( $result );
$percent = round($row['online']/$row['total'],0);
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 'check WHERE id = '1'' at line 1
I log in to the database, and there is a table named 'check'.
The field type of 'id' is int. For the others it is varchar.
Thanks!