Forum Moderators: open
HTML form option code for dropdown list on 'size':
<option value="1-5/8"">1-5/8"</option>
PHP functions on variable:
$goodsize = stripslashes($_POST['size']);
print "$goodsize ";
$fgoodsize = mysql_real_escape_string($goodsize);
print "$fgoodsize";
print results: 1-5/8 1-5/8 (no quote shows up)
MySQL line:
$query = "INSERT INTO buttons
('id', 'artist', 'button_name', 'size',' price', 'sold', 'where_sold', 'date', 'image_file', 'page')
VALUES (0, '{$_POST['artist']}',
'{$_POST['button_name']}',
'$fgoodsize', // field in question is here
'{$_POST['price']}',
'{$_POST['sold']}',
'{$_POST['where_sold']}',
NOW(),
'{$_POST['image_file']}',
'{$_POST['page']}')";
ERROR MSG:
Could not add the entry because: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''id', 'artist', 'button_name', 'size',' price', 'sold', 'where_sold', 'date', 'i' at line 2. The query was INSERT INTO buttons ('id', 'artist', 'button_name', 'size',' price', 'sold', 'where_sold', 'date', 'image_file', 'page') VALUES (0, 'CD', 'Test Button', '1-5/8', '6', '0', '', NOW(), 'cd-test-form.jpg', 'green.htm').
Again, thanks for any ideas! (Of course I'm not entirely sure the query is right anyway (with or without the quote!) lol.
Clair