I’ve created a new table to hold form data, but I can’t get my plugin to insert any new records. Here’s the code I’m using:
$wpdb->query("INSERT INTO wp_reg (ID, slname, sfname, plname, pfname, email, phone, cellphone) VALUES (NULL, $slname, $sfname, $plname, $pfname, $email, $phone, $cellphone)");
Can someone who knows more about PHP, MySQL, and the $wpdb class help me figure out how to get this to work? (And if there’s nothing wrong with the code, might there be something wrong with how the database is set up that would prevent new records being inserted?)
- The topic ‘Plugin won’t insert data into new table’ is closed to new replies.