convert a code block mysql to mysqli
Hi, this code was original coded for mysql and I was wondering how easy would it be to convert to mysqli
<?php
mysql_select_db($database_dinkydb, $dinkydb);
$query_CatgFinger = "SELECT * FROM productcategories";
$CatgFinger = mysql_query($query_CatgFinger, $dinkydb) or die(mysql_error());
$menuList = array();
while ($row = mysql_fetch_assoc($CatgFinger)) {
array_push($menuList,array('CategoryLocation' => $row['CategoryLocation'],'CategoryLink' => $row['CategoryLink'], 'CategoryName' => $row['CategoryName']));
}
?>
<?php
function get_menu_items($menuList = array(), $categroyLocation = '') {
$obj = NULL;
foreach($menuList as $key => $val){
if($val['CategoryLocation'] == $categroyLocation) {
$obj .= '<li class="left"><a href="../Category/' . $val['CategoryLink'] . '" >' . $val['CategoryName'] . '</a></li>';
}
}
return $obj;
}
?>
<li class="left"><a href="#">Fingerprint Jewellery</a>
<ul class="dropdown">
<?php echo get_menu_items($menuList,'Fingerprint-Jewellery'); ?>
</ul>
</li>
<?php echo get_menu_items($menuList,'Paw-Prints'); ?>
<li class="left"><a href="#">Hands & Feet</a>
<ul class="dropdown">
<?php echo get_menu_items($menuList,'Hands-Feet'); ?>
</ul>
</li>
<?php echo get_menu_items($menuList,'Word-Art'); ?>
<?php echo get_menu_items($menuList,'In-Remembrance'); ?>
<li class="right"><a href="../contact.php">Contact</a></li>