Page 1 of 1
haven't problem with the insert syntax...
Posted: Thu Jun 17, 2004 12:40 pm
by Xplosion84
Code: Select all
<?php
$add = "INSERT INTO products (ID, Cat_ID, Sub_Cat_ID, Product_Number, Product, Man_ID, Descriptions, In_Stock, Show_Quanity, Quanity, Cost, Sell_Price, Taxable, Tax_Price, Dementions, Weight) VALUES ('', '. $_POST['Category'] . ', ' . $_POST['Subcategory'] . ', ' . $_POST['Subcategory'] . ', ' . $_POST['ProductNumber'] . ', ' . $_POST['ProductName'] . ', ' . $_POST['Manufacturers'] . ', ' . $_POST['Descriptions'] . ', ' . $_POST['InStockCheck'] . ', ' . $_POST['ShowQCheck'] . ', ' . $_POST['Quanity'] . ', ' . $_POST['OurCost'] . ', ' . $_POST['SellPrice'] . ', ' . $_POST['TaxableCheck'] . ', ' . $_POST['TaxPrice'] . ', ' . $_POST['Dementions'] . ', ' . $_POST['WeightCheck'] . ')";
?>
I know that syntax is incorrect i'm not sure on how to get it to work.. Also my ID column is set to autimatically number so I'm not sure on what to do in the VALUES for that... it's the first line...
-peace
Posted: Thu Jun 17, 2004 12:42 pm
by magicrobotmonkey
echo it out before inserting it and post that echo here
Posted: Thu Jun 17, 2004 12:45 pm
by feyd
attempting to use the original would result in a few T_STRING error/warning/notices...
Code: Select all
<?php
$add = "INSERT INTO products (ID, Cat_ID, Sub_Cat_ID, Product_Number, Product, Man_ID, Descriptions, In_Stock, Show_Quanity, Quanity, Cost, Sell_Price, Taxable, Tax_Price, Dementions, Weight) VALUES ('', '{$_POST['Category']}', '{$_POST['Subcategory']}', '{$_POST['Subcategory']}', '{$_POST['ProductNumber']}', '{$_POST['ProductName']}', '{$_POST['Manufacturers']}', '{$_POST['Descriptions']}', '{$_POST['InStockCheck']}', '{$_POST['ShowQCheck']}', '{$_POST['Quanity']}', '{$_POST['OurCost']}', '{$_POST['SellPrice']}', '{$_POST['TaxableCheck']}', '{$_POST['TaxPrice']}', '{$_POST['Dementions']}', '{$_POST['WeightCheck']}')";
?>
Posted: Thu Jun 17, 2004 12:47 pm
by markl999
Try:
Code: Select all
$add = "INSERT INTO products (Cat_ID, Sub_Cat_ID, Product_Number, Product, Man_ID, Descriptions, In_Stock, Show_Quanity, Quanity, Cost, Sell_Price, Taxable, Tax_Price, Dementions, Weight) VALUES ('{$_POST['Category']}', '{$_POST['Subcategory']}', '{$_POST['Subcategory']}', '{$_POST['ProductNumber']}', '{$_POST['ProductName']}', '{$_POST['Manufacturers']}', '{$_POST['Descriptions']}', '{$_POST['InStockCheck']}', '{$_POST['ShowQCheck']}', '{$_POST['Quanity']}', '{$_POST['OurCost']}', '{$_POST['SellPrice']}', '{$_POST['TaxableCheck']}', '{$_POST['TaxPrice']}', '{$_POST['Dementions']}', '{$_POST['WeightCheck']}')";
[edit] feyd beat me to it, took ages to type out as well!!

Posted: Thu Jun 17, 2004 12:49 pm
by feyd
yeah.. took a bit of time to type..