hi, i'm writing on a code with php and mysql.
the idear is:
$add=mysql_query("SELECT * FROM $shop WHERE ct='$REMOTE_ADDR' AND title='$row[title]'",$connection);
while($row=mysql_fetch_array($add))
{
if(!empty($row[quantity])) {
$add2 = "INSERT INTO $DB VALUES ('$id','$title','$lang','$qe','$px','$REMOTE_ADDR')";
$result2b = mysql_query($add2, $connection);
} else {
$qe2=$row[qe]+1;
$add2 = "UPDATE $DB SET quantity='$qe2' WHERE ct='$REMOTE_ADDR' AND title='$row[title]')";
$result2a = mysql_query($add2, $connection);
}
}
But since the Row is empty it does nothing! How can I say if the row is empty then "INSERT * INTO ..." else "UPDATE $DB ..."
Thx for helping