Hi thanks for the reply I am doing abit of what you said here is my updated code:
<?php
$sql="SELECT id,title,sort_order FROM gallery WHERE area=$area ORDER BY sort_order ASC;";
$result=mysql_query($sql);
$entries = mysql_num_rows($result);
if(isset($_POST['submit'])){
$id = $_POST['id'];
$sort_order = $_POST['sort_order'];
for($i=0;$i<$entries;$i++){
mysql_query("UPDATE gallery SET sort_order='$sort_order[$i]' WHERE id='$id[$i]'") or
die(mysql_error());;
}
}
?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" name="form1">
<table cellspacing="1" cellpadding="0">
<tr>
<td>Name</td>
<td>Title</td>
</tr>
<?php
while($info = mysql_fetch_assoc($result)){
?>
<input type="hidden" name="id[]" value="<? echo $info['id'];?>" />
<tr>
<td><? echo $info['title'];?></td>
<td><input type="text" name="sort_order[]" value="<? echo $info['sort_order'];?>" /></td>
</tr>
<?php
}
?>
<tr>
<td align="center"><input type="submit" name="submit" value="Submit" /></td>
</tr>
</table>
</form>
<?php
mysql_close();
?>
But its not putting the code how i want it here is the html output of 1 of the input fields:
<input type="hidden" name="id[]" value="120" />
<tr>
<td>Unreal Character 1</td>
<td><input type="text" name="sort_order[]" value="2" /></td>
</tr>
So its not getting the info into the right places.
and then when i press submit i get to errors:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /gallery-admin/sort.php on line 17
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /gallery-admin/sort.php on line 39
thanks