Jump to content

What does this error message mean


rashawn13

Recommended Posts

 function get_mysql_data(){
		include'../ipod/configure/db.php';

		$item="SELECT * FROM PRODUCTS";

		$query=mysql_query($item);
		echo"<table> <tr>";
			while ($items = mysql_fetch_object($query))
			{
				echo'<td><h2>'.$items->name.'</h2>
				<div class="description">
				<span>'.$items->description.'</span>
				<img src="'.$items->img.'">
				<div class="price">
					'.$items->price.'
				</div>
				<div class="addtocart"> <a href="#">Add to cart </a> </div>
				</td>';

			}
         	
         }

Warning: mysql_fetch_object(): supplied argument is not a valid MySQL result resource in /home/content/r/a/s/rashawn1312/html/ipod/design/templates.php on line 41

<<<< this is the code that appears i would just like to know how to fix the message

 

Link to comment
https://forums.phpfreaks.com/topic/192739-what-does-this-error-message-mean/
Share on other sites

It means that u are not connected to databse or u have not selected any database to work with or maybe u dont have table called PRODUCTS?

 

mysql_connect(...);
mysql_select_db("YOUR_DB_NAME");

//now u can execute mysql queries and fetch results

 

If your ../ipod/configure/db.php looks something like @mysql_connect() or @mysql_select_db() remove @ and see if u get more errors.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.