Jump to content

I NEED HELP


brandon000

Recommended Posts

Buddy ol' Pals...I need your help.  I know this is probably such an easy fix but for the life of me I can't figure it out.

 

Can you tell me what I'm missing as far as getting this to work:

mysql_query("INSERT INTO product_sizes (SizeID,Size,StyleID) SELECT SizeID, Size From table_sizes Where table_sizes.SizeID=".$SizeID[$i].",".$StyleID);

 

Everything works fine right up to the first two value inserts (SizeID,Size) but when I try adding the third variable (StyleID) ...I can't get this to insert any records.  Do I have the correct syntax at the end of the statement?

 

 

 

Just for reference here is the complete function:

==========================================================

 

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {

 

$StyleID=$_SESSION['StyleID'];

$SizeID=$_POST['SizeID'];

 

for( $i=0; $i < count($SizeID); $i++){

mysql_query("INSERT INTO product_sizes (SizeID,Size,StyleID) SELECT SizeID, Size From table_sizes Where table_sizes.SizeID=".$SizeID[$i].",".$StyleID);

}}

 

Link to comment
https://forums.phpfreaks.com/topic/98703-i-need-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.