update mysql table using php

From: Date: Mon, 13 Aug 2001 07:29:18 +0000
Subject: update mysql table using php
Groups: php.db 
Request: Send a blank email to php-db+get-11274@lists.php.net to get a copy of this message
The following is a portion of the code I have in my php script. elseif ($submit=="Update categories") { if (is_array($Cat_ID)) { while (list($key,$value) = each($Cat_ID)) { print "<li>Updated entry #$value\n"; $query = "update $table2 set CatName = '$CatName', CatDescribe = '$CatDescribe' where Cat_ID = $value"; mysql_query($query) or die("The submitted category could not be added."); print "<br><br>"; print "<a href=" . '"' . "display.php" . '"' . ">Return to the Categories index.</a>"; } } } I know there are no problems connecting to the database; I know it is able to establish a connection. Also, I know that CatName and CatDescribe are valid Column Names in my table. Any ideas as to what the problem is? Thank you.

« previous php.db (#11274) next »