Can't call an object method. PHP reports variable undefined
<p>This is the weirdest bug!  It is probably something silly, but I have no idea how to fix it.  If anyone could help, I would be most grateful!  I have three files, one is called items.php, another is called tableFunctions.php, and the third is called mysql.php.  I use two global objects called 'mysql' and 'tableFunctions'.  They are stored in the files 'mysql.php', and 
'tableFunctions.php', respectively.  In each file, I create an instance of its object, assigning it to the global variable $_mysql, or $_table.  like this:</p>

<p>In the file mysql.php:</p>

<pre><code>global $_mysql;
$_mysql = new mysql();
</code></pre>

<p>In the file tableFunctions.php:</p>

<pre><code>global $_table;
$_table = new tableFunctions();
</code></pre>

<p>Here's how it is supposed to work:</p>

<p>The items.php file includes the tableFunctions.php file...
Which in turn, needs the mysql.php file, so it includes it too.</p>

<p>In the items.php file, I call the method getTable(), which is contained in the object tableFunctions.(and in the variable $_table.) Like this:</p>

<pre><code>$t = $_table-&gt;getTable('items');
</code></pre>

<p>The getTable function calls the method, arrayFromResult(), which is contained within in the object mysql.(and in the variable $_mysql.) Like this:</p>

<pre><code>$result  = $_mysql-&gt;arrayFromResult($r);
</code></pre>

<p>That's where I get the error.  PHP says that the variable '$_mysql' is undefined, but I defined it in the 'mysql.php' file.(see above)  I also included mysql.php with the following code:</p>

<pre><code>include_once 'mysql.php';
</code></pre>

<p>I have no idea what is wrong!  If anyone can help that would be much appreciated.
The source files can be downloaded with the following link: <a href="https://www.dropbox.com/sh/bjj2gyjsybym89r/YLxqyNvQdn" rel="nofollow">https://www.dropbox.com/sh/bjj2gyjsybym89r/YLxqyNvQdn</a></p>
