thanks Ray - works great
As am going through the various pages to convert, have another one that am unsure how to convert to mysqli where the database connection is $DBConnection:
<?php
function cmp($a, $b) {
return ($a[2] < $b[2] || ($a[2] == $b[2] && $b[2] == $b[1]))? -1: 1;
}
if (isset($_POST["UpdateOrder"])) {
mysql_select_db($database_PowerCMSConnection, $PowerCMSConnection);
$OrderArray = array();
$start = 1;
while (isset($_POST["FaqID_".$start])) {
$OrderArray["Products_". $_POST["FaqID_".$start]] = array($_POST["FaqID_".$start],$start,$_POST["FaqOrder_".$start]);
$start ++;
}
$start = 1;
uasort($OrderArray, "cmp");
foreach ($OrderArray as $Products) {
mysql_query("UPDATE faqs SET FaqOrder = ". $start ." WHERE FaqID = " . intval($Products[0]), $PowerCMSConnection) or die(mysql_error());
$start++;
}
}
?>