Need assistance with a mysql error
Hoping someone can help me out with a problem. it appears to be a syntax problem but I can't hammer down what exactly the problem is... I am using the latest version of mysql

I am getting this error: 

"Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\...\testing_album_func.php on line 14"

Here is my code:

LINE 9. function get_listings() { 

LINE 10.	$listings = array();

LINE 11.	$listings_query = mysql_query("SELECT `class_ads`.`ad_id`, `class_ads`.`created_on`, 
                LEFT(`class_ads`.`title`, 50) as `title`, LEFT(`class_ads`.`description`, 50) as  
                `description`, `class_ads`.`price`,	`class_ads`.`quantity`,   
                COUNT(`images`.`image_id`) as `image_count` FROM `class_ads` LEFT JOIN `images` ON 
                `class_ads`.`ad_id`=`images`.`ad_id` WHERE `user_id`='".$_SESSION['user_id']."' GROUP
                 BY `class_ads`.`ad_id`");

LINE 13.	
 
LINE 14.	 while ($listings_row= mysql_fetch_assoc($listings_query)) {

LINE 15.		 $listings[] = array(

LINE 16.		 'ad_id' => $listings_row['ad_id'],

LINE 17.		 'created_on' => $listings_row['created_on'],

LINE 18.		 'title' => $listings_row['title'],

LINE 19.		 'description' => $listings_row['description'],

LINE 20.		 'price' => $listings_row['price'],

LINE 21.		 'quantity' => $listings_row['quantity'],

LINE 22.		 'image_count' => $listings_row['image_count']	
	 
LINE 23.		 );

LINE 24.	 }

LINE 25.	return $listings;

LINE 26.        }



Need assistance with a mysql error
===

Hoping someone can help me out with a problem. it appears to be a syntax problem but I can't hammer down what exactly the problem is... I am using the latest version of mysql

I am getting this error: 

"Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\...\testing_album_func.php on line 14"

Here is my code:

LINE 9. function get_listings() { 

LINE 10.	$listings = array();

LINE 11.	$listings_query = mysql_query("SELECT `class_ads`.`ad_id`, `class_ads`.`created_on`, 
                LEFT(`class_ads`.`title`, 50) as `title`, LEFT(`class_ads`.`description`, 50) as  
                `description`, `class_ads`.`price`,	`class_ads`.`quantity`,   
                COUNT(`images`.`image_id`) as `image_count` FROM `class_ads` LEFT JOIN `images` ON 
                `class_ads`.`ad_id`=`images`.`ad_id` WHERE `user_id`='".$_SESSION['user_id']."' GROUP
                 BY `class_ads`.`ad_id`");

LINE 13.	
 
LINE 14.	 while ($listings_row= mysql_fetch_assoc($listings_query)) {

LINE 15.		 $listings[] = array(

LINE 16.		 'ad_id' => $listings_row['ad_id'],

LINE 17.		 'created_on' => $listings_row['created_on'],

LINE 18.		 'title' => $listings_row['title'],

LINE 19.		 'description' => $listings_row['description'],

LINE 20.		 'price' => $listings_row['price'],

LINE 21.		 'quantity' => $listings_row['quantity'],

LINE 22.		 'image_count' => $listings_row['image_count']	
	 
LINE 23.		 );

LINE 24.	 }

LINE 25.	return $listings;

LINE 26.        }


