Hi I am new to this forum and I hope someone could help me with my coding because i am getting a syntax error. Please any subjection ??
This is the error I am getting
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 '["sub_id"]}' at line 1
here is my code:
<?php
$sub_query = mysql_query('SELECT FROM Subject');
if(!$sub_query){
die(mysql_error());
}
while($sub_result = mysql_fetch_array($sub_query)){
echo "<li>{$sub_result['sub_name']}</li>";
error $page_query = mysql_query('SELECT FROM pages WHERE Subject_Id = {$sub_result["sub_id"];}');
if(!$page_query){
die(mysql_error());
}
echo '<ul class="pages" >';
while($page_result = mysql_fetch_array($page_query)){
echo "<li>{$page_result['sub_name']}</li>";
}
echo '</ul';
}
?>