Hi All, I have this code creating a list in a select box. All works ok, I get my list BUT and a NIG BUT.
When I select an item to delete it only ever deletes from the last record to the top. Errrrrr why ? I think all my code is in the right order but obviously not. Can anyone throw some light on this. As always thanks for past and future help Dave C :-) ----------MY CODE STARTS HERE ----------------------- $deloptions_sql = "select * from $tbn2"; $delresult = mysql_query($deloptions_sql, $con) or die("error: ".mysql_error()); $delrows = mysql_num_rows($delresult); for ($i = 0; $i < $delrows; $i++) { $listdelrows = mysql_fetch_array($delresult); $name2 = $listdelrows[name]; $id2 = $listdelrows[id]; $del_list .="<option name=\"delprod\" value=\"$id2\">$name2</option>"; } if($delproduct){ $del_sql ="delete from $tbn2 where id = '$id2' and name = '$name2'"; $del_res = mysql_query($del_sql,$con) or die ("Unable to Delete Product"); $delproductmsg = "Deleted $name2 from $p_cat_name"; } --------------ENDS HERE------------------------------- Dave Carrera Website Designer http://www.davecarrera.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php