Resource id #7?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Red Blaze
Forum Commoner
Posts: 40
Joined: Mon Mar 27, 2006 3:45 pm

Resource id #7?

Post by Red Blaze »

I'm getting this problem, and I have no clue what it means. This is the bit of code.

Code: Select all

$sql = 'SELECT * FROM orders WHERE cartid = "'.$cartid.'" AND customerID  = "'.$userid.'"';
	$query = mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($query) != 0){
    //rows found
	}else{	
mysql_query("INSERT INTO orders (ordernum,cartid,album,albumid,customer,customerID,phone,email,photographer,address,city,state,zip) VALUE ('$new_name','$cartid','$albumname','$aid','$customer','$userid','$phone','$email','$photographer','$address','$city','$state','$zip')");
mysql_query('UPDATE carts SET ordernum = "'. $new_name .'", locked = "'. 1 .'" WHERE itemID = "'. $cartid .'"');
}
In MySQL, Resource id #7 is what gets stored in photographer from the INSERT query. But it's right. $photographer is a hidden form that has the correct value. Are there other problems that can cause that error? Thanks in advance.

~RB
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

resource id is a resultset, search the manual for it
Post Reply