code updating 3
Hi Ray, I have the following old code (using old mysql server behaviours) and which to change it to mysqli
Im stuck on this old code changing to mysqi
<?php
$_GET['OptionGroupID'] = $row_ItemOptions['OptionGroupID'];
$colname_ItemGroupOptions = "-1";
if (isset($_GET['OptionGroupID'])) {
$colname_ItemGroupOptions = $_GET['OptionGroupID'];
}
mysql_select_db($database_dinkydb, $dinkydb);
$query_ItemGroupOptions = sprintf("SELECT * FROM options WHERE OptionGroupID = %s ORDER BY OptionPrice, OptionName", GetSQLValueString($colname_ItemGroupOptions, "int"));
$ItemGroupOptions = mysql_query($query_ItemGroupOptions, $dinkydb) or die(mysql_error());
$row_ItemGroupOptions = mysql_fetch_assoc($ItemGroupOptions);
$lowPrice = $row_ItemGroupOptions["OptionPrice"];
?>
I got as far as this:
<?php
$rsItemGroupOptions = new WA_MySQLi_RS("rsItemGroupOptions",$ecartdb,0);
$rsItemGroupOptions->setQuery("SELECT * FROM options WHERE OptionGroupID = ? ORDER BY OptionPrice, OptionName");
$rsItemGroupOptions->bindParam("s", "".(isset($_GET['OptionGroupID'])?$_GET['OptionGroupID']:"") ."", "-1"); //colname
$lowPrice = $rsItemGroupOptions["OptionPrice"];
$rsItemGroupOptions->execute();
?>
But when I run the code, it doesnt like: $lowPrice = $rsItemGroupOptions["OptionPrice"]; inside the recordset.
and I am stuck on $_GET['OptionGroupID'] = $row_ItemOptions['OptionGroupID']; which I need to place in the mysqli bindParam section.
Chris