I think this part something is wrong:
?>
<?
// update sort order
if (isset($_POST['update']) || isset($_POST['pass'])){
$sql= mysql_query("select * FROM resource_category") or die (mysql_error());
$num = mysql_num_rows($sql);
for($j=1;$j<($num+1);$j++){
$member_id="id_".$j;
$order_id="order_".$j;
$member_order="location_".$j;
$id=$_POST[$member_id];
$order=$_POST[$order_id];
$location=$_POST[$member_order];
mysql_query("UPDATE resource_category SET location='$location' WHERE cate_id='$id' ") or die(mysql_error());
if ( $order != $location ){
mysql_query("UPDATE resource_category SET location_date=now() WHERE cate_id='$id' ") or die(mysql_error());
}
}
}
?>
<?
// get resource directory data
$quest = mysql_query("SELECT resource_category.cate_id AS category_id,resource_category.location AS location,resource_category.hit AS hits,resource.cate_id AS resource_cate_id, resource_category.cate_title AS title, count(resource.cate_id) AS numbers FROM resource_category LEFT JOIN resource ON resource_category.cate_id = resource.cate_id GROUP BY resource_category.cate_id ORDER BY location ASC,location_date DESC");
?>
<table width="593" cellpadding="0" cellspacing="0" border="0" align="center" class="admin_member">
<tr>
<th>Order</th>
<th align="left">Category</th>
<th>Entries</th>
<th>Hits</th>
<th>E/D</th>
</tr>
<form method="post" action="<?=$_SERVER["PHP_SELF"]?>">
<?
$i=1;
while( $row = mysql_fetch_assoc($quest)) {
// alternate row color
$classname = ($i % 2) ? 'odd1' : 'even1';
?>
<tr>
<td class="<?=$classname;?>" width="10%" align="center"><input type="text" name="location_<?=$i;?>" value="<?=$row['location'];?>" size="1"></td>
<td width="50%" align="left" class="<?=$classname;?>">
<input type="hidden" name="order_<?=$i;?>" value= "<?=$row['location'];?>">
<input type="hidden" name="id_<?=$i;?>" value= "<?=$row['category_id'];?>">
<a href="admin_view_resource.php?cate_id=<?=$row['category_id'];?>" class="delete"><?=stripslashes(htmlspecialchars($row['title']));?></a>
</td>
<td width="10%" align="center" class="<?=$classname;?>"><?=$row['numbers'];?></td>
<td width="20%" align="center" class="<?=$classname;?>">
<span><?=$row['hits'];?></span> <a HREF="javascript:popUp('admin_resources_reset.php?hit=<?=$row['category_id'];?>')" class="delete">(reset)</a>
</td>
<td width="10%" align="center" class="<?=$classname;?>">
<!-- <a href="#" class="delete" id="<?=$row['id'];?>" onclick="show_edit(this)"><img src="images/edit.gif" border="0"></a> -->
<a href="admin_edit_service_privder.php?cate_id=<?=$row['category_id'];?>"><img src="images/edit.gif" border="0"></a>
<a HREF="javascript:popUp('admin_delete_rseource_category_new.php?cate_id=<?=$row['category_id'];?>')" class="delete"><img src="images/delete.gif" border="0"></a>
</td>
</tr>
<?
$i++;
}
?>
</table>
<?php