I have a mysql table that holds a name and an optional numeric code.. with the numeric code (ie. 302) being optional. So in my PHP, I have this:
Code: Select all
if (isset($_POST['numeric_code']))
$clean['numeric_code'] = $_POST['numeric_code'];
else
$clean['numeric_code'] = NULL;So here in lies the problem I am having.
Code: Select all
CREATE TABLE names_and_codes (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
persons_name VARCHAR(100) NOT NULL,
numeric_code TINYINT UNSIGNED DEFAULT NULL,
PRIMARY KEY (id)
);Code: Select all
$query = "INSERT INTO names_and_codes (persons_name, numeric_code) VALUES ('{$clean['persons_name']}', {$clean['numeric_code']})";Any help would GREATLY be appreciated. Thanks!