Page 1 of 1

Problems with extract function causing page timeout.

Posted: Fri Jun 19, 2009 11:00 am
by clem_c_rock
Hello,
I just ported a site over to a new server w/ a newer version of php.

I am having a strange problem using the extract() function to extract contents of a mysql_fetch_array.

I know it's the extract function because when I comment it out the page loads with no problem.

here's my code:

Code: Select all

 
$sql_select = "select property.*, layout.* from property,layout where property.property_id=$property_id and layout.property_id=$property_id";
$result = mysql_query ($sql_select, $conID); 
 
$row = array();          
while($row = mysql_fetch_array($result, MYSQL_ASSOC)){ extract($row); } 
 
Any ideas on why this is happening?

thanks for your time!

Re: Problems with extract function causing page timeout.

Posted: Fri Jun 19, 2009 12:39 pm
by Benjamin
:arrow: Moved to PHP - Code

You've been here long enough to know where to post questions and how to post code with php tags. Don't do this again.

Re: Problems with extract function causing page timeout.

Posted: Fri Jun 19, 2009 12:51 pm
by requinix
Do you understand what extract does? At the very least you should see how misusing it can break your code.