• Resolved desbest

    (@desbest)


    I’m trying to use WordPress data outside of WordPress, to create new users and login, when people to do the same for my website.

    How do I specify the table prefix when using wp-load.php?

    This code causes this error.

    define('WP_USE_THEMES', false);
    require("council/wp-load.php");

    Table ‘yprice_wrdp1.users’ doesn’t exist

    The table prefix is _wp, so basically, WordPress or wp-load.php, should actually be looking for the wp_users table instead of the users table.

    So how do I specifiy the table prefix to look for?

    I’ve searched using Google, Stack Exchange, WordPress forum and codex, and I can’t find anything. :/

    PS. Yes the table prefix is correctly defined in wp.config.php, and my WordPress installation works.

Viewing 3 replies - 1 through 3 (of 3 total)
  • shouldn’t need to specify a prefix, it works if WP gets included correctly…

    Where is the install in relation to the file?

    define('WP_USE_THEMES', false);
    require('./council/wp-load.php');

    Works for me (for including WP, with my file in root, and WP one directory away, /council here)

    Thread Starter desbest

    (@desbest)

    I found out what the problem was. I included the required WordPress code, before my config.php database connect code, and now it works.

    I’m glad you got it sorted out!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How do I specifiy the table prefix when using wp-load.php?’ is closed to new replies.