Re: A very basic PHP question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm not sure this has to do with Variable Scope. (Scope has to do with when you can or can't reference a variable ... for example, that you may have defined in a different function than the currently-running code).

I don't actually understand your question that well, either. Can you elaborate? Which value are you asking how to change?

As I understand it, your code basically does the following:

[Assumes $offset and $type are passed in from whatever code calls this function]
Defaults $offset to 0 if it wasn't defined.
Generates one of three different queries based on the passed-in "type":
- "today" generates a SQL statement using today's date.
- "tomorrow" generates a SQL statement using tomorrow's date.
- "week" generates a SQL statement using the next week (or rather, it tries to, but the SQL statement will in fact return every single gig in the system OTHER than the ones in the next 5 days). The SQL Statement is cleaned using a safe_query function, and returned to the code that called this function.

So if you're asking how to change the value of "type", you just go to the code elsewhere in your application that calls "select_entries_quick()" and change the third parameter.

If you have a different question, can you elaborate?

-P


Nasreen Laghari wrote:
Hi,
I have some confusion with Variables scope. I searched but couldn't figure it out :( The question is:
  one variable which changes according to if... else statment, how do you change the value of that variable?
Actually $query is changing on $type variable so I tried doing using if.. else statment. Please clarify me.

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux