What the heck am I doing wrong here?
Posted: Tue Mar 11, 2008 10:30 am
This is so weird. I don't get why this ain't working... but I'm sure one of you will make me feel like the stupidest person in the whole wide world:
To show you what is going wrong... if I do this:
I get this...
INSERT INTO ins_system (message_id, item_name, item_id) VALUES (5, '', )
Any help is greatly appreciated.
Code: Select all
$_POST['item_id_1'] = '9889AA';
$_POST['item_name_1'] = 'steaks';
$i = 1;
$clean['message_id'] = 1234;
$clean['item_name_' . $i] = escape_data($_POST['item_name_' . $i]);
$clean['item_id_' . $i] = escape_data($_POST['item_id_' . $i]);
$query = "INSERT INTO ins_system (message_id, item_name, item_id) VALUES ({$clean['message_id']}, '{$clean['item_name_".$i."']}', {$clean['item_id_".$i."']})";Code: Select all
echo $query;INSERT INTO ins_system (message_id, item_name, item_id) VALUES (5, '', )
Any help is greatly appreciated.