When using the client, I force $productid to a valid productid. I'm updating
if ($current_priority == 0)
There are no errors returned with mysql_error() and mysql_affected_rows() returns 1 as it should. I don't understand why this query works in the client but not with php. Many other update queries I have written in php work just fine. Any and all help is greatly appreciated.
Thanks in advance, Adam.
$rand_banner_query = "update affiliate_products join affiliates on affiliate_products.affiliateid=affiliates.affiliateid set affiliate_products.current_priority=affiliates.priority where affiliate_products.productid='$productid'";
$rand_banner_result = query($rand_banner_query);
mysql> describe affiliates;
+-------------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+------------------+------+-----+---------+----------------+
| affiliateid | int(10) unsigned | | PRI | NULL | auto_increment |
| name | varchar(50) | | | | |
| website | varchar(100) | YES | | NULL | |
| email | varchar(50) | YES | | NULL | |
| pi | varchar(20) | YES | | NULL | |
| priority | int(10) unsigned | YES | | NULL | |
+-------------+------------------+------+-----+---------+----------------+
mysql> describe affiliate_products;
+------------------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------------+------------------+------+-----+---------+----------------+
| productid | int(10) unsigned | | PRI | NULL | auto_increment |
| product | varchar(100) | | | | |
| description | text | YES | | NULL | |
| type | varchar(10) | | | | |
| url | varchar(150) | YES | | NULL | |
| affiliateid | int(10) unsigned | YES | | NULL | |
| current_priority | int(10) unsigned | YES | | NULL | |
+------------------+------------------+------+-----+---------+----------------+