I managed to sort this out.. There wasn't anything wrong with the query or the
inserts my brains was frozen!

having problems with the new query to pull the records back though if anyone
wants to give a hand?

Andrew

>-----Original Message-----
>From: Andrew Maynes [mailto:[EMAIL PROTECTED]]
>Sent: 07 February 2003 21:54
>To: MySQL-Lista
>Subject: MySQL query inserts from a table join
>
>
>I don't know whetehr this is going to make any sense!
>
>I have a query pulling records from MySQL tables that are joined.  The join is
>for a color_id to an item...
>
>///////////////////////////////////////////////
>function showColor($item_id)
>{
> $query="select ref_colours.* from item_color ,ref_colours where
>ref_colours.ColorID=item_color.color_id and item_color.item_id=$item_id";
>$rs=mysql_query($query);
>       if(!$rs)
>       {
>       echo "Error while exeuting the query";
>       }
>       else
>       {
>       while($row=mysql_fetch_array($rs))
>               {
>               $color_id=$row['ColorID'];
>               $cName=$row['ColorName'];
>               echo "<option value=\"$color_id\">$cName</option>";
>               }
>       }
>}
>
>I guess without beating about the bush I just need to ask.  What should the
>value be set to for me to insert the color into a table along with the rest of
>the chosen items details?  this is the form:
>
>echo "<SELECT name=\"cName\" value=\"$cName\">";
>showSize($II);
>echo "</SELECT> ";
>
>
>this is the add.php insert....
>
>mysql("$DBName","INSERT INTO CartItems VALUES
>('$UID','$ItemID','$ItemQuantity','$Date','$CartItemsID','$cName')");
>
>
>but this is just inserting a value of 1 everytime :(
>
>Thank you all for reading my problem :)
>Andrew
>
>
>
>
>
>---------------------------------------------------------------------
>Before posting, please check:
>   http://www.mysql.com/manual.php   (the manual)
>   http://lists.mysql.com/           (the list archive)
>
>To request this thread, e-mail <[EMAIL PROTECTED]>
>To unsubscribe, e-mail
><[EMAIL PROTECTED]>
>Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
>---
>Incoming mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.449 / Virus Database: 251 - Release Date: 27/01/2003
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to