PHP global variable question... Wordpress involved but think it is a PHP issue

Whether you are familiar with Wordpress or not I think I can get help with someone who just knows more about PHP than I do. Feel like this is probably a basic programming question and part of the reason for my frustration. I have been trying to get the following code to insert data in the table that it just created. Debug is saying that the $table_name variable is not defined in the function called jal_install_data(). So here is the code…

http://pastebin.com/xyHW7z1w\

Here is the forum topic I posted in on the Wordpress.org forums…

http://wordpress.org/support/topic/creating-tables-with-plugins-codex-page-incomplete?replies=2

Thus far I have not received any help. So I thought I would tackle the PHP issue because I feel like it is something that has to do with their Global variable not working how they intended. When I define the variable the same way it is defined in the first function it works properly. Frustrating.

Any help is very much appreciated. Thanks for the time.

Firstly, echo the variable outside of the variables to make sure the file is actually within the scope of the variable. If so, the functions may not be, so try putting “global $table_name;” in there.

Sponsor our Newsletter | Privacy Policy | Terms of Service