hey folks, as i m moving towards my php learning joruney i m facing another probelm. i got the idea of concatination but i m unable to follow inplace subsitution (the curly braces replacement for .) here is a query i m following from a tutorial but something is wrong after WHERE. can anyone help me. its giving me error
$result= mysql_query("SELECT * FROM pages WHERE subject_id = {$row["id"]}");
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 ‘’ at line 1. here is the complete php
<?php
$result= mysql_query("SELECT * FROM subjects");
if(!$result){
die ("<strong>". mysql_error() ."</strong>");
}
while ($row = mysql_fetch_array($result)){
echo "<li>".$row["menu_name"] ."</li>";
//echo pages related to subjects
$result= mysql_query("SELECT * FROM pages WHERE subject_id = {$row['id']}");
if(!$result){
die ("<strong>". mysql_error() ."</strong>");
}
echo "<ul class=\\"pages\\">";
while ($row = mysql_fetch_array($result)){
echo "<li>".$row["menu_name"] ."</li>";
}
echo "</ul>";
}
?>