Hey, Thanks LordShryku
but it doesn't seem to do the trick. Here's the rest of the code if it helps
// Database Variables
$mysql_host = "localhost";
$mysql_user = "user";
$mysql_pass = "pass";
$mysql_db = "db";
// Open DB Connection
mysql_connect( $mysql_host, $mysql_user, $mysql_pass );
mysql_select_db( $mysql_db );
$cat_text="categories";
$c=explode("|",$cat_text);
$c_n=count($c);
for ($i=0; $i<$c_n; $i++) {
getgals($c[$i]);
}
function getgals($cat) {
GLOBAL ${$cat};
$query = "SELECT cat, url, des from galleries WHERE cat = '{$cat}' AND cat is NOT NULL";
$galleries=mysql_query($query) or die("Bad Query!");
while ($g_temp[] = mysql_fetch_array($galleries)) {
/* ...... */
}
${$cat} = array();
$total=count($g_temp);
for ($i=0; $i<$total; $i++) {
${$cat}[$i] = " <a href='" . $g_temp[$i][1] . "'>" . $g_temp[$i][2] . "</a><br>";
}
shuffle(${$cat});
}
$a=0;