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

  • Home
  • SEARCH
  • 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 6819969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:22:08+00:00 2026-05-26T21:22:08+00:00

Does anyone see anything wrong with what I am doing here? I haven’t worked

  • 0

Does anyone see anything wrong with what I am doing here? I haven’t worked with the database expressions in WP yet. All of my code runs except when I start to try to add items to tables I have created in the WP database. Any info would be greatly appreciated. To me it seems that this syntax is correct and should run.

$wpdb->insert($wpdb->prefix . 'venue', array('event_id' => $event_id, 
                                    'event_date' => $event_date, 
                                    'venue_name' => $venue_name, 
                                    'venue_city' => $venue_city, 
                                    'ticket_url' => $ticket_url, 
                                    'event_url' => $event_url), 
                                array(%d, %s, %s, %s, %s, %s) );

Many thanks.

UPDATE!: There seems to be an issue connecting to the WP database from within an AJAX call. I am using jQuery to call a php file and trying this within the PHP file. This does not seem to work as maybe the $wpdb class is outside of the scope?

  • 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-05-26T21:22:08+00:00Added an answer on May 26, 2026 at 9:22 pm

    The values in the array containing the fieldtypes should be between ' and '.

    So that would become:

    array('%d', '%s', '%s', '%s', '%s', '%s')
    

    Instead of:

    array(%d, %s, %s, %s, %s, %s)
    

    Hope this can be of help for others having this problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

http://dabbler.org/home/asdf/scrolling/test.html Does anyone see anything wrong with this code? I can't figure out what
Does anyone see anything wrong with this code: MailMessage msg = new MailMessage(); msg.From
See here: http://code.google.com/p/ie7-js/ Does anyone have any experience or remarks about this javascript? Is
Does anyone have experience using the URL Rewrite Module (see here )? Can it
Does anyone see a problem with this, its not working saying bad file descriptor
Does anyone know how I can check to see if a directory is writeable
Does anyone have metrics on the utility of formal Unit Testing? I see a
I see a lot of IoC frameworks for .Net and Java. Does anyone know
Does anyone remember the XMP tag? What was it used for and why was
Does anyone know how to get IntelliSense to work reliably when working in C/C++

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.