So to use a global in one function in another you have to use the $GLOBALS. And if you use a global in one function but requesting it from anywhere on the page except for another function you can use global $var; Is that right?
Globals are "in" functions - that's the point - they're floating around outside all your functions; and if you want to use them inside any function, then that function has to declare it. You can use "global $foo;" to do this, or you can take advantage of the fact that PHP maintains a list (obviously) of all of the global variables currently defined, which to you as a programmer looks like an array named $GLOBALS[].
"global $foo;" is just shorthand for saying "$foo =& $GLOBALS['foo'];", which says that $foo is an alias for the same global variable list entry that $GLOBALS['foo'] is.
But why are you using globals anyway? There's no good reason here at least.
function GetBikeInfo($table_names)
{
require("include/bike_cnt.php");
require("include/session.php");
$Query = "SELECT " . $table_names . " FROM $TableName_b WHERE bike_name='$user'";
$Result = mysql_db_query($DBName, $Query, $Link) or die(mysql_error());
return mysql_fetch_array ($Result);
}
function CallBike()
{
require("PAGE2");
$bike_info = GetBikeInfo("*");
echo $bike_info;