...

View Full Version : When Updating a One-Row Table ?



jeddi
04-30-2011, 01:24 PM
Hi,

I have a table which contains just one row, and is updated each day.

Like this:



$sql = "UPDATE pdc_promo_count SET cntr = '$new_cntr'"; // only one row
mysql_query($sql)or die("could not UPDATE pdc_promo_count". mysql_error());

As you can see, I don't have a WHERE clause.

Do I need one when there is only one row ?



.

Wojjie
04-30-2011, 02:08 PM
If it is one row, you can get away without a WHERE clause.

As for performance concerns, not sure, would have to benchmark it, though I would assume it would be very small/negligible difference.

MarPlo
04-30-2011, 02:08 PM
Hy,
your sql works fine as it is if the table has one row.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum