MemphiS Posted July 13, 2007 Share Posted July 13, 2007 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'"); Quote Link to comment https://forums.phpfreaks.com/topic/59795-mysql-question/ Share on other sites More sharing options...
MadTechie Posted July 13, 2007 Share Posted July 13, 2007 both about the same but i would probably choose $points = $the[1] + $rand; mysql_query("UPDATE `theIDs` SET `points` = '$points' WHERE `id` = '$getID'"); Quote Link to comment https://forums.phpfreaks.com/topic/59795-mysql-question/#findComment-297300 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.