Hey,
I have about 5 pages, first page has a couple of fields and all the other pages have different checkboxes on them, pages going in sequence, like you can see in the link below:
http://taxmon.designrobot.co.za/dialup/step1.html
The method im thinking of, is to insert the field values into the table, and then use an update query on the same ID for the rest of the pages containing checkboxes, but not sure how to go about it!
Im thinking about basing it on this code:
$color = $_POST['color'];
$self = $_SERVER['PHP_SELF'];
#connect to mysql
$conn=@mysql_connect( "localhost", "user", "pass" )
or die( "Error connecting to MySQL" );
#select specified database
$rs = @mysql_select_db( "capetownalive", $conn )
or die( "Error connecting to db" );
if(!empty($_POST['color']) && is_array($_POST['color'])) {
$_POST['color'] = array_map('mysql_real_escape_string', $_POST['color']);
$colors = implode('\'), (\'', $_POST['color']);
$query = 'INSERT INTO colors (color) VALUES (\'' . $colors . '\')';
$rs = mysql_query($query);
} else {
// they didn't specify a color, or there was a problem with the data type
}
Really desperate to get this working, would really appreciate any advice or comments.
Thanks alot
Chris