• Resolved billc108

    (@billc108)


    I’m having some trouble with wpdb->insert. From everything I’ve read, the insert below should be formatted correctly. The database has a table named Directory with four columns as named.

    $insertresult = $wpdb->insert('Directory', array( 'dir_id' => '4', 'U_ID' => '2227', 'contactname' => 'contact', 'contactnamedisplay'=>'1'));

    This is my first time working with $wpdb… I can easily do the same with a regular database query, but I’m trying to play by WP’s rules. Any idea where I’m messing up?

    Thanks.

Viewing 1 replies (of 1 total)
  • Thread Starter billc108

    (@billc108)

    Solved. I didn’t have
    global $wpdb;
    where it would affect the particular if statement which was showing problems.

Viewing 1 replies (of 1 total)

The topic ‘wpdb->insert problem’ is closed to new replies.