Jump to content

Mysql question


MemphiS

Recommended Posts

My examples below to describe what im asking

$the = mysql_fetch_row(mysql_query("SELECT `id` , `points` FROM `theIDs` WHERE `idaccepted` = '1' ORDER BY id DESC"));
//other code...
..my question:

$rand = rand(0,10);
is it better to do:
mysql_query("UPDATE `theIDs` SET `points` = points+$rand WHERE `id` = '$getID'");
or;
$points = $the[1] + $rand;
mysql_query("UPDATE `theIDs` SET `points` = '$points' WHERE `id` = '$getID'");

Link to comment
https://forums.phpfreaks.com/topic/59795-mysql-question/
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.