All - I found this code from another forum and it works with MYSQL and PHP.
Could someone help with the conversion of this code for usage in PHP and MS ACCESS?
Thanks.
Could someone help with the conversion of this code for usage in PHP and MS ACCESS?
Thanks.
Code:
MYSQL QUERY TO GET ALL AVAILABLE OPTIONS
mysql_select_db($database_siteConn, $siteConn);
$query_rsGetfeatures = "SELECT options.optionID, options.option FROM options_group INNER JOIN options ON options_group.optionID = options.optionID WHERE options_group.option_typeID = 1 AND formOption = 1";
$rsGetfeatures = mysql_query($query_rsGetfeatures, $siteConn) or die(mysql_error());
$row_rsGetfeatures = mysql_fetch_assoc($rsGetfeatures);
$totalRows_rsGetfeatures = mysql_num_rows($rsGetfeatures);
SELECT LIST
<select name="option[]" size="15" multiple id="option[]">
<?php do { ?>
<option value="<?php echo $row_rsGetfeatures['optionID']?>"
<?php echo (in_array($row_rsGetfeatures['optionID'], $on))? 'selected':''; ?>>
<?php echo $row_rsGetfeatures['option']?></option>
<?php
} while ($row_rsGetfeatures = mysql_fetch_assoc($rsGetfeatures));
$rows = mysql_num_rows($rsGetfeatures);
if($rows > 0) {
$row_rsGetfeatures = mysql_fetch_assoc($rsGetfeatures);
}
MYSQL QUERY TO GET STORED VALUES
mysql_select_db($database_siteConn, $siteConn);
$query_rsGetStored = "SELECT options.optionID, options.option FROM options_group WHERE options_group.vehicleID = '". $_SESSION['vehicleID'] . "' AND formOption = 1";
$rsGetStored = mysql_query($query_rsGetStored, $siteConn) or die(mysql_error());
$row_rsStored = mysql_fetch_assoc($rsGetStored);
$totalRows_rsGetStored = mysql_num_rows($rsGetStored);