Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8764841
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:07:54+00:00 2026-06-13T16:07:54+00:00

I’ve manually created a custom table, sdp_invites , for my wordpress (v3.4.2) site. I’ve

  • 0

I’ve manually created a custom table, sdp_invites, for my wordpress (v3.4.2) site. I’ve done this many times in the past, but now I’m unable to use any of the $wpdb methods:

global $wpdb;
global $current_user;

$query = "INSERT INTO spd_invites (sender_id,receiver_id,job_id,job_title,job_slug,employer_id) VALUES ('{$current_user->ID}','{$resume->user_id}','{$job_id}','{$job_title}','{$job_slug}','{$employer_id}')";

$wpdb->get_results($query); //ERROR...
$wpdb->query($query); //ERROR...

Here’s the error:

WordPress database error: [Table 'sow2.spd_invites' doesn't exist]
INSERT INTO spd_invites (sender_id,receiver_id,job_id,job_title,job_slug,employer_id) VALUES ('799','809','6','Professional Basket Weaver','professional-basket-weaver','5')

I know the table exists because I manually created it and I can see it in phpMyAdmin. Any idea why I’m getting this error?

UPDATE:
The WP user is called “root” (on my local dev setup). Here’s the privileges listed in phpMyAdmin:

User    Host             Type    Privileges  Grant  Action
root    localhost    global  ALL PRIVILEGES  Yes    

UPDATE2:
Just to rule out a bunch of possibilities, I tried a simpler query: "SELECT * FROM sdp_invites". This throws the same error. When I change to a wp core table, it works without error "SELECT * FROM sdp_invites"

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T16:07:55+00:00Added an answer on June 13, 2026 at 4:07 pm

    My best guess is that you haven’t granted permission to you WordPress MySQL database user for your new custom table, presumably because you created it with a different MySQL user through phpMyAdmin. Try running:

    GRANT ALL PRIVILEGES ON sow2.spd_invites TO 'wordpress_user'@'wordpress_host';
    FLUSH PRIVILEGES; -- load new privileges
    

    Replace “wordpress_user” with your WordPress MySQL username (can be found in wp-config.php) and “wordpress_host” with the hostname of your WordPress server (or localhost if it’s on the same server).

    Keep in mind that this will allow the WordPress MySQL full permissions (SELECT, INSERT, DROP, etc) to this table, which may not be desirable. See the MySQL docs for my info on the GRANT command – http://dev.mysql.com/doc/refman/5.5/en/grant.html

    You will want to run your insert using the query() function as it won’t return any results:

    $wpdb->query($query);
    

    To view all tables visible to your WordPress MySQL user, add the following to your theme’s functions.php file to print out the table names at the bottom of every page:

    function show_all_tables(){
        global $wpdb; 
        foreach($wpdb->get_results("SHOW TABLES", ARRAY_N) as $table): 
            echo $table[0]."<br/>"; 
        endforeach;
    } 
    add_action('wp_footer', 'show_all_tables');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want to count how many characters a certain string has in PHP, but
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.