Using form to pass data to $wpdb->insert
-
I am getting a slew of errors on this one line of code. I am trying to use a form to input a new row into a table.
$wpdb->insert ( $wpdb->prepare(‘salaries’,array( ‘id’ => ‘$_POST[“id”]’, ‘name’ => ‘$_POST[“name”]’,’nine’ => ‘$_POST[“nine”]’ ), array( ‘%s’, ‘%s’, ‘%s’ ) ));
Warning: Missing argument 2 for wpdb::insert(), called in /home/apnason/public_html/beerlyrics.com/wp-content/plugins/salaries/salaries.php on line 33 and defined in /home/apnason/public_html/beerlyrics.com/wp-includes/wp-db.php on line 737
Warning: array_keys() [function.array-keys]: The first argument should be an array in /wp-includes/wp-db.php on line 739
Warning: Invalid argument supplied for foreach() in /wp-includes/wp-db.php on line 741
Warning: implode() [function.implode]: Invalid arguments passed in /wp-includes/wp-db.php on line 750
WordPress database error: [Unknown column ” in ‘field list’]
INSERT INTOsalaries
() VALUES (”)
The full code is here: https://pastie.org/private/yvzwiqtwrev2zdiw3lioq
Any help? Thanks.
- The topic ‘Using form to pass data to $wpdb->insert’ is closed to new replies.