I am getting following error when trying to click the next or previous button on following site:
http://bdworld.co/newest.php?categoryId=35
Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/content/69/9332569/html/imagewar/newest.php on line 30
Newest Pictures! ( Others )
SQL query failed. Check your query.
Error Returned: 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 'ORDER BY m_date DESC' at line 1You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY m_date DESC' at line 1
The code in line 28-32 is:
<?php
$result = mysql_query("SELECT cat.Name, sub.Name FROM sub_categories sub, categories cat WHERE cat.Id = sub.CategoryId AND sub.id=$categoryId;");
while($row = mysql_fetch_array($result)){
$categoryName=$row["0"];
$subCategoryName=$row["1"];
Can anyone tell me what is the problem