I get a syntax error when I try to execute a query Each time I run the following code, I get an error.

$result = db_query(“SELECT nid FROM 'msg'”);
foreach ($result as $record) {
  // Do something with each $record
}


The error is the following one:


  Parse error: syntax error, unexpected T_STRING


How do I fix the error?
You should do

$result = db_query("SELECT id FROM {mg}");


It doesn't look like you should get parse error unless you really use “” and not ""