NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Undefined Variable error when running encoded (MySQL) site


Joined: 10 Jan 2010
Posts: 3
Reply with quote
Hi

I'm testing the evaluation version of NuCoder with my web app and get undefined variable errors when using variables initialized from a MySql query as below:

$sql = "SELECT * FROM some_table
WHERE some_condition";
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
if ($row) {
extract($row);
$shopConfig = array('shopName' => $sc_name,
'address' => $sc_address,
'phone' => $sc_phone,
'email' => $sc_email)
}

Obviously the code works OK on an un encoded site but after encoding, each of the variables $sc_* throws an undefined error.
I can see why this would happen since the variables do not exist until the successful extract() but does anyone know a way around this?
I use this type of method all over the place and it's a show stopper for me if I can't find a way around it.

Thanks.

_________________
NC
View user's profileFind all posts by nigelcorbySend private message
Fixed


Joined: 10 Jan 2010
Posts: 3
Reply with quote
I fixed this by disabling obfuscation. Works like a charm now.

_________________
NC
View user's profileFind all posts by nigelcorbySend private message
Undefined Variable error when running encoded (MySQL) site
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic