OK, so I have populated a table, I was wondering if I can run this to check if the table DOESNT have a certain ID number, then an update function can add a new row, is this coherent or am I retarded?
Here is my code:
<?php
$ListQuery = "SELECT * FROM relist where vid='".addslashes($tlist[7])."'";
$ListQueryRS = mysql_query($ListQuery);
$TotList = mysql_num_rows($ListQueryRS);
if($TotList>0)
{
mysql_query("UPDATE relist SET newdate = '".$AuctionDate."' WHERE vid = '".addslashes($tlist[7])."'");
}
else
{
mysql_query("UPDATE relist SET id='', vid = '".addslashes($tlist[7])."', origdate='".$AuctionDate."', newdate='".$AuctionDate."'");
}
?>