Problems with extract function causing page timeout.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
clem_c_rock
Forum Commoner
Posts: 46
Joined: Mon Jun 07, 2004 9:18 am

Problems with extract function causing page timeout.

Post 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!
Last edited by Benjamin on Fri Jun 19, 2009 12:38 pm, edited 1 time in total.
Reason: Changed code type from text to php.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: Problems with extract function causing page timeout.

Post 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.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Problems with extract function causing page timeout.

Post by requinix »

Do you understand what extract does? At the very least you should see how misusing it can break your code.
Post Reply