I have the following sql script which runs perfectly in MySQL.
However, I tried to do the same thing in PHP, it comes back as error. It complains about WHERE clause.
$query = 'SELECT p.LName, p.FName, p.Mi, p.Phone, h.SecName, s.GClass';
$query .= 'FROM table_personal AS p, table_hs AS h, table_student AS s, table_status AS t';
$query .= 'WHERE t.Program = $_SESSION[\'application\'] AND p.AppId = t.AppId AND p.AppId = h.AppId AND p.AppId = s.AppId';
What's wrong with this code?