I'm puzzled because the following works fine:
PHP Code:
 $info=mysql_query("SELECT works.id, mid, modes_name " .
                   
"FROM works, modes " .
                   
"WHERE works.id=$_GET[id] AND works.mid=modes.id ");
  if (!
$info) {
    echo(
"Error fetching information: " .
      
mysql_error());
    exit(); 
But the following produces an error:
PHP Code:
 $info=mysql_query("SELECT works.id, works.kid, keys.key_name " .
                   
"FROM works, keys " .
                   
"WHERE works.id=$_GET[id] AND works.kid=keys.id ");
  if (!
$info) {
    echo(
"Error fetching information: " .
      
mysql_error());
    exit(); 
I've checked and rechecked the database structure for the 'modes' and 'keys' tables and they're the same. The 'works' table has both 'mid' and 'kid' fields. The error that the second bit of code produces is:
Error fetching information: You have an error in your SQL syntax near 'keys WHERE works.id=39 AND works.kid=keys.id ' at line 1
Does anyone see a problem? Thanks!