Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.