• Resolved Anonymous User 5580574

    (@anonymized-5580574)


    Hi there, at first thank you very much for this fantastic and necessary plugin! Actually everything works fine. ;D

    Beneath other scripts I do include (via require_once) an external php-file with some variables and for one variable (the date) I ask the database to give me the information and write it into the variable. For this db-query I add this:

    error_reporting (E_ALL);
    $connection = mysql_connect ("localhost","database", "password") or die ("no connection");
    mysql_select_db("table") or die ("doesnt exist");

    Wenn I push the “test”-button in the plugin the results are correct (!). BUT when I publish the article some other theme-parts (from other plugins) are broken. When I delete the 2nd line (mysql_select_db(“table”)), it works again (for sure without the date), but it works fine. So what’s the matter with the database-inclusion? What I made wrong? Or HOW to include some database-entries?

    Thx+Regards
    Sebastian

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor M66B

    (@m66b)

    I have no idea what is going wrong, but maybe you should try the standard WordPress database functions to prevent interfering with the WordPress framework. Don’t forget to do a global $wpdb;.

    Thread Starter Anonymous User 5580574

    (@anonymized-5580574)

    I got it… As it’s mentioned here you need to add a “TRUE” if you use the same connection.

    So it should look like this (compare to code above):

    error_reporting (E_ALL);
    $connection = mysql_connect ("localhost","database", "password", TRUE) or die ("no connection");
    mysql_select_db("table") or die ("doesnt exist");

    Topic resolved.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Shortcode Exec PHP] Including MySQL-Query destroys theme’ is closed to new replies.