storing product options in an order history table
Hi I have a range of product options (due to complexity of them, I had to create them as an array) (the product options are made up as a series of text fields, checkboxes and select lists).
How would I go about storing these in an order history table? I have read a little on the php command "serialize" would it be best to use this method to pass the array into a database?
since there are many different product options relating to a single product I was assuming that I would need 3 tables:
1. order summary
2. orders
3. orderProductOptions
then then "orderProductOptions would have a field that stores the ID from order summary table. Would that make sense?
currently on my cart.php I am displaying the options by this code:
<?php
$options = $DinkyCart->DisplayInfo("Options");
$optionArray = explode("<br>",$options);
$optionInfo = array();
for ($x=0; $x<sizeof($optionArray)-1; $x++) {
$optionInfo[] = explode("**",$optionArray[$x]);
}
?>
-----------------------------------------------------------
<tr>
<td valign="top"><p><strong>Options</strong></p>
<p>
<?php
for ($y=0; $y<sizeof($optionInfo); $y++) {
?>
<?php echo($optionInfo[$y][0]); ?>
<br>
<?php
}
?>
</p>
td>
<td align="right" valign="top">
<?php
for ($y=0; $y<sizeof($optionInfo); $y++) {
?>
£<?php echo(number_format($optionInfo[$y][1],2)); ?>
<br>
<?php
}
?>
</p></td></tr>