I am trying to create custom input tables to send data into custom tables on the wp database. I cannot get my script to do anything. The user will enter a type of liquor, like vodka or whiskey, provide a description, and send it to the database, where there are custom tables within the wordpress database. I have the html code in a wordpress page and the php in a file called setLiquorType.php that is in the main wordpress folder.
HTML Form
<form method = "post" action = "setLiquorType.php">
Add a New Liquor Type</br></br>
<p>Name: <input type="text" name="name"/></p>
<p>Description <input type="text" name="description"/></p>
----------------------------------------------
<input type="submit" value="Submit"/>
</form>
</br>
My php script
<?php
$name = $_POST['name'];
$global $wpdb, $name, $description;
$table_name = $wpdb->prefix . "Liquor Type";
$wpdb->insert($table_name, array(
'lq_name' => $lq_name,
'description' => $lq_descrip
),array(
'%s',
'%d')
);
}
?>
Any help would be great
$global $wpdb
instead ofglobal $wpdb
, so I'm guessing your insert code isn't running.