View Full Version : Resolved SQL/PHP Variable...
roclafamilia
11-21-2008, 06:08 AM
i have this code, where i call the exact same value from a database 3-4 times on the same page...is it better for me to assign that value from the database to a local variable so that i do not need to call the database 3-4 times, or should i just call the database 3-4 times?
PappaJohn
11-21-2008, 06:50 AM
It would be better to run the query once and assign it to a variable as opposed to running multiple identical queries.
Even though the overhead of 3 queries would be relatively small, it sounds like there is no benefit in doing so.
roclafamilia
11-21-2008, 07:35 AM
thanks, i was not sure for security reasons.
vBulletin® v3.8.2, Copyright ©2000-2010, Jelsoft Enterprises Ltd.