[thelist] MySQL Inserts

Andrew Maynes andrew at humanbehaviour.co.uk
Tue Jan 28 14:16:08 CST 2003


Now that I dont have my form workiong properly I thought it best to check with
the gurus on a small problem.

A form is going to input an item record into a table whilst at the same time
inserting attributes to the same item that are held in a different table:  Is
this the way to do it?

mysql_connect("$DBHost","$DBUser","$DBPass");
mysql("$DBName","INSERT INTO Items VALUES(
'$ItemSKU',
'$ItemName',
'$ItemDescription',
'$ItemCost',
'$Category',
'$ShippingCost',
'$ItemID')");

mysql_connect("$DBHost","$DBUser","$DBPass");
mysql("$DBName","INSERT INTO itemcolor VALUES(
'$ColorID',
'$ItemID')");


or do I need only one INSERT query and connect?  records are being added but
only 0 0

Andrew



Tel: +44 (0) 777 55 212 95

**********************************************************************
Information in this email is confidential and may be privileged.
It is intended for the addressee only. If you have received it in error,
please notify the sender immediately and delete it from your system.
You should not otherwise copy it, retransmit it or use or disclose its
contents to anyone.
Thank you for your co-operation.
**********************************************************************




More information about the thelist mailing list