Links Categories select ( "select * from locations where parent=0 order by name" ); //$db->print_last_query(); while ( $row = $db->get_row ( $res, 'MYSQL_BOTH' ) ) { ?>

Location

Location Name:

Parent Location:

"; ?> "; ?>
select ("SELECT name From locations WHERE name='{$location}'") or die('error in selection.'); $count=mysql_num_rows($select_loc); if($count==0) { $id = $db->insert_sql ( "INSERT INTO `locations` (`name` ,`parent`) VALUES ('" . ucfirst($_POST ['name']) . "', '" . $_POST ['parent'] . "')" ); $msg="Location inserted"; } else{ $msg="$location Already Exist"; } //$db->print_last_query(); print ""; exit (); } } if (isset ( $_POST ['bt_update'] )) { $id = $db->update_sql ( "update `locations` set `name`='" . ucfirst($_POST ['name']) . "' ,`parent`='" . $_POST ['parent'] . "' where locationid=" . $_GET ['location'] ); //$db->print_last_query(); print ""; } if (isset ( $_GET ['del'] )) { $id = $db->delete ( "delete from locations where locationid=" . $_GET ['del'] ); //$db->print_last_query(); print ""; } ?>