beetle
08-06-2002, 09:40 PM
How do I use extract() on an array but also make sure all the variables become global? Here's what I got
<?php
include("/includes/db_connect.php");
$sql = "SELECT * FROM config";
$result = mysql_result($sql) or die("Query Failed ".mysql_error(););
$fetch = mysql_fetch_array($result);
extract($fetch,EXTR_SKIP);
?>So basically I've extracted the results from MySQL into the symbol table, but how to I make sure each is global? I was going to skip using extract() and use a foreach() loop instead...but I'm not sure how to get it all done right.
<?php
include("/includes/db_connect.php");
$sql = "SELECT * FROM config";
$result = mysql_result($sql) or die("Query Failed ".mysql_error(););
$fetch = mysql_fetch_array($result);
extract($fetch,EXTR_SKIP);
?>So basically I've extracted the results from MySQL into the symbol table, but how to I make sure each is global? I was going to skip using extract() and use a foreach() loop instead...but I'm not sure how to get it all done right.