run query problem
Hi,
I need help in INSERT query. i want to insert this data via INSERT query. but the query dont run. neither it displays any error/warning message.
INSERT INTO temp_sale (salepersonid, product_id, cat_id, action_id, prod_name, short_desc, long_desc, picture_url, price) VALUES('5', 'T63-2', '15', '321', '', 'Features a variety of carnations and daisies in a lovely basket. Approximately 20" H x 16" W.', 'The serenity of cattails surrounded by the excitement of blazing blooms. Soothing, thrilling...they'll love the contrast! Features a variety of carnations and daisies in a lovely basket. Approximately 20" H x 16" W.', 'images/HW0_1644.jpg', '45.00')
The PHP code is as follows.
$query2 = "INSERT INTO temp_sale (salepersonid, product_id, cat_id, action_id, prod_name, short_desc, long_desc, picture_url, price) VALUES('" . $saleid . "', '" . $productid . "', '" . $cat_id . "', '" . $action_id . "', '" . $item_name . "', '" . $short_desc . "', '" . $long_desc . "', '" . $picture_url . "', '" . $price . "')";
db_connect($default_dbname);
mysql_query($query2);
FYI, DB connection is OK before running this query i am running a SELECT query successfully. what i guess that a single quote "'" in the data to be inserted is causing problem. Is there any way to insert large data that can contain "'"?
Thanks in advance.
Musharaf Choudhry
|