Hello all,
I have an issue regarding using variables from my global.php in a hiarachy of documents.
I will explain how this works. I have my index.php in the root of my server, I then include the global.php file and from then on I include a handle.php file for the related page and from that file I usually include another file realted to what part of that page they require.
Okay so far I have created the members system (register login verify etc.) that works fine but the issue comes when running a query in the global.php to get all of the users details:
if( @mysql_num_rows( $query_user ) < 1 ) {
force_500();
} else {
$row = mysql_fetch_array( $query_user );
$query_user2 = mysql_query("SELECT * FROM `users` WHERE `id` = '" . $row['id'] . "'");
while( $ui = mysql_fetch_array( $query_user2 ) ) {
$username = $ui['username'];
global $username;
$id = $ui['id'];
global $id;
$email = $ui['email'];
global $email;
}
}
I can use the variables created in the original index.php, the issue is using them in the included documents. Functions created in the global.php work fine but the varibales (including others) don't. I have tried declairing them global but that doesn't seem to work.
INCLUDED DOCUMENTS (NOT GLOBAL.PHP)
global $username;
Any help would be great,
Thanks.