I have the follow MySQL queries for pulling out ans then inserting a
>record from
>a record set.  Unfortunately I think I have missed something (vital) as the
>record being inserted is the value and not the name, for example 1 instead of
>blue... can someone kindly have a look and spot where I have gone wrong?
>
>
>records pulled:
>
>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>";
>               }
>       }
>}
>
>records displayed: (and the actual color names displyed!!!)
>
>echo "<SELECT name=\"size\" value=\"$size\">";
>showSize($II);
>echo "</SELECT> ";
>
>record selected inserted into a temp table: (but the color value instead of the
>color name goes in)
>
>mysql("$DBName","INSERT INTO CartItems VALUES
>('$UID','$ItemID','$ItemQuantity','$Date','$CartItemsID','$ColorName','
>$size')")
>;
>
>I have tried inserting color_id and cName too but no joy.  This is not making
>sense.  I has previously been said but that just doesn't follow with the logic.
>
>If a color name has been pulled why isn't the said color name selected being
>inserted.  If this makes sense to someone I am listening with speakers
>turned up
>high.
>
>Thank you
>
>Andrew
>
>
>
>
>---
>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