Jump to content

My Query Woes, Updating into a blank row?


virtuexru

Recommended Posts

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."'"); 
}
?>

Link to comment
https://forums.phpfreaks.com/topic/148950-my-query-woes-updating-into-a-blank-row/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.