Problem with simple update

From: Date: Fri, 24 Jan 2003 10:42:56 +0000
Subject: Problem with simple update
Groups: php.general 
Request: Send a blank email to php-general+get-132964@lists.php.net to get a copy of this message
I am trying to set the order of a set of categories. Previously the catid field sorted the order of the categories. However I changed this to Order By catorder and then set about writing a simple update query to allow people to set the order. I can't see anything wrong with this: Basically I pull the details from the categories DB into an array and then display in a table. This works fine <? while ($array = mysql_fetch_array($mysql)) { echo "<tr><td width='150'><span class='adminisoleipa'>"; echo "<input type='hidden' name='categoryid' value='{$array["catid"]}'>"; echo "{$array["catname"]}"; echo "</td><td><input type='text' size='2' name='catorder' value='{$array["catorder"]}'>"; echo "</span></td></tr>"; } ?> Then using this to update it seems to work till you check the update. It sets the first two fields to one for some reason. $query = "update categories set catorder = '$catorder' where catid='$categoryid'"; Any suggestions? Steve Jackson Web Developer Viola Systems Ltd. http://www.violasystems.com stephen.jackson@violasystems.com Mobile +358 50 343 5159

« previous php.general (#132964) next »