The most common way to debug queries (at least, the method I prefer) is to write them as such:
$query = 'query here';
$exec = mysql_query($query) or die('MySQL error: ' . mysql_error() . '<br><br>Query: ' . $query);
That way, if an error occurs, you not only have the error text returned by MySQL but you also have the query executed so that you can visually inspect it.
Also, in your code, $id is the same on each iteration of the foreach() loop, so it's very wasteful and much slower to execute the query inside the loop - it's going to return the same data every time!
While we're talking about SQL optimization, you could remove the quotes around $id since it's (presumably) a numeric value (which sounds like it should have a PRIMARY UNIQUE index..?). In addition, I would recommend you never use a 'SELECT *' query but instead SELECT only the columns you actually need data from.