Jump to content

[SOLVED] PHP Variable loading from database, constantly checking?


Stryves

Recommended Posts

I've been doing minor adjustments to my code lately and I was curious about the following...

 

1. Let's say we run $query = "select * from clients" (I'm suming up here... )

2. If I declare that $clientname=$query['clientname'];

3. I use the variable $clientname 10 times in my code.

 

Does it check the database ten times to find the clientname, or does it only check the first time to determine the variable value?

 

The reason I ask, I don't want to constantly check the database if it can be avoided... It may be very minimal, but I was lead to believe that using $query['clientname'] ten times would check the database each time.

 

Sometimes I use variable 50-100 times in my code I'm building.

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.