Insert to Database from form submit
-
Everytime I try to submit a form into the database with INSERT, I get an error:
Fatal error: Call to a member function prepare() on a non-object in /…/…/saveTemplate.php on line 17
<?php global $wpdb; $field1 = $_POST['tmplName']; $sql = $wpdb->prepare( "INSERT INTO 'wp_templates' ('templateName') values ", $field1); $wpdb->query($sql); ?>Can you please help me?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Insert to Database from form submit’ is closed to new replies.