Title: php problems must solve
Last modified: August 18, 2016

---

# php problems must solve

 *  [L](https://wordpress.org/support/users/l/)
 * (@l)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/php-problems-must-solve/)
 * I have two php problems.
 * 1/ I have one script that when I include it wordpress starts to look in its database
   for the info, and obviously it says that that particluar table doesn’t exist 
   in that database.
 * 2/ I have another script that is suppose to go before the html tag and the other
   part after the close html tag. Now this script is breaking most likely due to
   the fact that it’s split between two different pages, because it works on the
   rest of my site. Any ideas how to solve this one?
 * Thanks for any help.

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/php-problems-must-solve/#post-326833)
 * 1/ If an error message is appearing what is that error message?
 * 2/ Might need to put something in pastebin like [http://pastebin.com/](http://pastebin.com/)
   then report back the url of that paste.
 * Someone might find a link to view the problem useful…
 * ********************
    Welcome to the WordPress Support Forums!
 * Please help keep the Forums successful by reading:
    [Using the Support Forums](http://codex.wordpress.org/Using_the_Support_Forums)
 * Also, remember the [WordPress Codex](http://codex.wordpress.org/Main_Page) and
   the [FAQ pages](http://codex.wordpress.org/FAQ).
 * And, thank you, for letting us know if this information proves useful (or not)!
   ********************
 *  Thread Starter [L](https://wordpress.org/support/users/l/)
 * (@l)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/php-problems-must-solve/#post-326909)
 * 1/ The first error looks like:
    WordPress database error: [Table ‘gp_members.
   wpgp_options’ doesn’t exist] SELECT option_value FROM wpJokes_options WHERE option_name
   = ‘kubrick_header_display’ LIMIT 1
 * 2/ As I said earlier there is nothing wrong with the code it self because it 
   works in every other page I have and with every other script, but you can find
   it here. [http://pastebin.com/526795](http://pastebin.com/526795)
 * Thanks for the response.
 *  [whooami](https://wordpress.org/support/users/whooami/)
 * (@whooami)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/php-problems-must-solve/#post-326919)
 * For #1
 * your not closing the query on the first mysql call that script makes, so wp is
   looking in it’s database instead of where it ought to be looking.
 * [http://us2.php.net/mysql_close](http://us2.php.net/mysql_close)
 * Check the script, and if thats the case, check some of my older posts — Ive answered
   this question before and explained how to add it.
 * When opening and closing multiple db’s within one page, its important to pay 
   attention to what db is opened first, closed first, etc..
 * ** Decently written scripts WILL always close persistent connections
 *  Thread Starter [L](https://wordpress.org/support/users/l/)
 * (@l)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/php-problems-must-solve/#post-326950)
 * OK, that worked somewhat. I put in the following:
 * <?php
    $link = mysql_connect(‘localhost’, ‘user’, ‘pass’); if (!$link) { die(‘
   Could not connect: ‘ . mysql_error()); } echo ‘Connected successfully’; mysql_close(
   $link); ?>
 * The original error is gone now, but a new error pops up. First, no database info
   for the sidebox shows, but the posts shows up in the main part of the page, and
   when clicked on it will go to the posts. And also, under the catagories in the
   sidebox I get “Warning: Invalid argument supplied for foreach() in /home/gpcommun/
   public_html/jokes/wp-includes/template-functions-category.php on line 321”. Where
   do I go with this now? Thanks.
 *  [whooami](https://wordpress.org/support/users/whooami/)
 * (@whooami)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/php-problems-must-solve/#post-326952)
 * welp, i cant exactly answer that because..
 * database info? what database info? info that wp should be getting or info that
   this other script should be getting? is there a mysql error echo’d to your page
   in lieu of that? wp mysql problems will echo out to the page, unless youre using
   2.0 and somethings changed that in that version that im not aware of.
 * I can make a suggestion to alleviate most, if not all of the db issues just by
   suggesting that you move the tables inside that second db over to your wp database.
 * If you dont want to do that, then youre on the right track .. like I said earlier,
   just make sure your aware of what mysql calls are being made, to where, AND when
   theyre closed
 * Is the newly added script working correctly? And btw, I would have done that 
   mysql_close at the bottom of the script (im not sure that matters though) The
   foreach() .. whats on line 321?
 *  Thread Starter [L](https://wordpress.org/support/users/l/)
 * (@l)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/php-problems-must-solve/#post-326958)
 * database info meaning what wp is suppose to be calling…showing up under archives
   and catagories.
 * The mysql error echo’d in lieu is the thing I stated just before: “Warning: Invalid
   argument supplied for foreach() in /home/gpcommun/public_html/jokes/wp-includes/
   template-functions-category.php on line 321”
 * It is 2.0 that I’m using.
 * The script works absolutley perfectly otherwise, and it plays perfectly well 
   with all the other php scritps/programs I have installed—ecommerce, advertising,
   guestbook, poll, and more.
 * When you say at the bottom of the script, what do you mean? Do you mean right
   after the php call within the wp header?–If that is the case, that is what I 
   did. If you mean within the script itself, that won’t be possible for me, because
   it is a huge multiple page memership script, so I have no idea what is the beginning
   or the end.
 *  Thread Starter [L](https://wordpress.org/support/users/l/)
 * (@l)
 * [20 years, 2 months ago](https://wordpress.org/support/topic/php-problems-must-solve/#post-327063)
 * Bump

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘php problems must solve’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 3 participants
 * Last reply from: [L](https://wordpress.org/support/users/l/)
 * Last activity: [20 years, 2 months ago](https://wordpress.org/support/topic/php-problems-must-solve/#post-327063)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
