How to tell if row doesn't exist in table?
Posted: Fri Mar 16, 2007 11:28 pm
I'm using this code to update my ebay auctions based on the auction id. This works fine but occasionally it trys to update an auction that is not in my table. I want to make it so if the auction isn't there then insert it. What is a good way to find out if the auction id isn't in the table?
Do I need to select * from the table and make a loop?
Code: Select all
tep_db_query("UPDATE `auction_list` SET `starttime` = '".$itemstarttime."',`endtime` = '".$itemendtime."', `amount` = '".$amountleft."' WHERE `auction_id` = '".$itemid."'");