Hi all,
The system im working on currently allows the user to select a number of flowers.. click submit and whatever they clicked is passed onto the next page, i now want them to click order and each flower is inserted into the table.
username - flowerid - qty - total
user1 ------------ 2 ------- 1----- 1.99
user1 ------------ 3 ------- 5----- 2.55
user1 ------------ 6 ------- 1----- 0.50
i havent set up the session yet to display the username etc... just trying to insrt the flowers selected into multiple rows... heres the code ive got so far.!
line 7 shows where i would but the sql statement that allows me to insert the records.
[PHP]<?php
include "constants/flowertimedbcnx .php";
echo 'You have chosen the following flowerids:<br>' ;
foreach($_GET['flowerid'] as $flower) {
$res = mysql_query ("SELECT * FROM flowers WHERE flowerid = $flower");
//$order = mysql_query ("INSERT INTO bqt_order VALUES ....... ?
while ($row = mysql_fetch_arr ay($res)) {
echo "$flower {$row['flowername']}";
echo " {$row['flowerdesc']} <br>";
}
}
?> [/PHP]
many thanks in advance to anyone who can help me with this!
The system im working on currently allows the user to select a number of flowers.. click submit and whatever they clicked is passed onto the next page, i now want them to click order and each flower is inserted into the table.
username - flowerid - qty - total
user1 ------------ 2 ------- 1----- 1.99
user1 ------------ 3 ------- 5----- 2.55
user1 ------------ 6 ------- 1----- 0.50
i havent set up the session yet to display the username etc... just trying to insrt the flowers selected into multiple rows... heres the code ive got so far.!
line 7 shows where i would but the sql statement that allows me to insert the records.
[PHP]<?php
include "constants/flowertimedbcnx .php";
echo 'You have chosen the following flowerids:<br>' ;
foreach($_GET['flowerid'] as $flower) {
$res = mysql_query ("SELECT * FROM flowers WHERE flowerid = $flower");
//$order = mysql_query ("INSERT INTO bqt_order VALUES ....... ?
while ($row = mysql_fetch_arr ay($res)) {
echo "$flower {$row['flowername']}";
echo " {$row['flowerdesc']} <br>";
}
}
?> [/PHP]
many thanks in advance to anyone who can help me with this!
Comment