> I think we are almost there. This code is not producing an error, but > it is also not incrementing the database. The value stays at zero. Any > idea what could be wrong? > > $inc_current_ad = WrapMySQLDatabaseResults("macasap", "update ads where > ad_id = ".$current_ad->Value("ad_id")." set > rotate=".($current_ad->Value("rotate")+1), "block=0","inc_current_ad"); > > Other queries of the same db on the page are working, so it's probably > not a configuration/connectivity issue.
Are you sure $current_ad->Value("rotate") is returning a value? Like someone else said, assign your query to another variable and print it out to make sure it makes sense. If you're just trying to increment "rotate" by one, then you can use Update ... set rotate = rotate + 1 where ... ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php