Let me first start to say my SQL is correct and checked it more than once.
I have 2 methods in my file calling more than once for the SQL but when it comes to the second part it won't return any value to fill in the fields.
Here is the part that is giving me issues:
$query = mysql_query("SELECT * FROM MegaFilter WHERE Parent = '".$ThisPage."' ");
while($query2 = mysql_fetch_assoc($query)) {
$SubID = $query2['Filter'];
$query3 = mysql_query("SELECT * FROM SubCategories WHERE ID = '".$SubID."' ");
while($query4 = mysql_fetch_assoc($query3)) {
$SubCatID = $query4['ID'];
$query5 = mysql_query("SELECT * FROM Web_Pages WHERE SubCat = '".$SubCatID."' ");
}
while($query6 = mysql_fetch_assoc($query5)) {
$ProductName = $query6['Title'];
$ProductID = $query6['ID'];
}
echo '<li class="item" data-id="id-'.$Productid.'" data-type="'.$SubID.'">'.$Productname.'</li>';
}
It does not log any errors except that the last 2 variables are not defined.