• Resolved matthewvanb

    (@matthewvanb)


    I’m creating a calander plugin, and on the first line of one of my PHP pages, I declare the $wpdb global so I can use a select statment to grab the data I need from the database… for some reason it says that the $wpdb global is null…

    here’s the code…

    <?php
    global $wpdb;
    var_dump($wpdb);
    ?>

    this declared on the very first line of the file… any suggestions?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter matthewvanb

    (@matthewvanb)

    just for clarification, I figured this out because when I tried to use wpdb->prefix it wasn’t returning the tables prefix into the select statement. That’s when I tried using the var_dump($wpdb) to see what it would return, and it told me it was NULL..

    add the file wp-load.php,

    for example:

    require_once(‘../../wp-load.php’);

    Thread Starter matthewvanb

    (@matthewvanb)

    you are a life saver! thanks.

    would you by chance know anything about creating “veiws”?

    a little explanation: like with the podcasting plugin, you place the “[podcast file]” code where you want the podcast file to be played….

    how do you create the [podcast file] code?

    I wanted the user to be able the type of calendar they wanted, and based off of their choices, create a [calendar view] code that would reflect there choice of options for that calander….

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

The topic ‘$wpdb returning null…’ is closed to new replies.