Is there some global array or something that contains all the variable names
(not even values per se) that are used in my script.

Here's the scenario. Like most of you, I do a lot of mySQL db work. So I
tend to use this:

if (mysql_num_rows($result) > 0) { 
  $row = mysql_fetch_array($result,MYSQL_ASSOC);
  while(list($myVariableName,$sqlFieldName)=each($row)) 
    { $$myVariableName = $sqlFieldName; }
}

So now I have a bunch of variables all named say, $company_name,
$company_id, $company_phone, etc...

What I want to do is make a function that can step through all the $company_
variables and unset them all.
(I imagine I'll just string compare to "company_" and then prefix the result
with $$, then set = "", etc. you get the idea)

I suppose I could re-write all my code and use the $row['company_id'] method
instead then clear $row[] but it would be nice to know if there is a way to
do this 'my way' as well...


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

Reply via email to