• 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)
  • 1/ If an error message is appearing what is that error message?

    2/ Might need to put something in pastebin like 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

    Also, remember the WordPress Codex and the FAQ pages.

    And, thank you, for letting us know if this information proves useful (or not)!
    ********************

    Thread Starter L

    (@l)

    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

    Thanks for the response.

    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

    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

    (@l)

    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.

    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

    (@l)

    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

    (@l)

    Bump

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

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