UPDATE command In SQL

From: Date: Mon, 31 Jul 2000 01:56:33 +0000
Subject: UPDATE command In SQL
Groups: php.general 
Request: Send a blank email to php-general+get-9098@lists.php.net to get a copy of this message
I am having trouble updating my database. My table has all varchar(25) except for the Number column which is an int . I have localized my problem to the actual query I give to the database. In Particular I think it may be my Number column. This is a snipet of my code. All the arrays come from the previous form. // Define all MYSQL Variables $host = "localhost"; $username = "username"; $password = "password"; $database = "database"; $table = "table"; // Conect to the database MYSQL_CONNECT ($host) or DIE ("Unable to connect to databse"); @mysql_select_db("$database") or DIE ("Unable to select database"); // Set all counters to 0 for flag pruposes $count = 0; while ($count < $i-1) { MYSQL_QUERY ("UPDATE $table SET Monday = '$mon[$count]', Tuesday = '$tues[$count]' , Wednesday = '$wed[$count]' , Thursday = '$thur[$count]' , Friday = '$fri[$count]' , Saturday = '$sat[$count]' WHERE Number = $num[$count]"); // Update Counters $count++; } MYSQL_CLOSE (); ?> <br><br> <center><h1>All records have been updated<h1></center> </body> </html> If anyone could help me out with this that would be great. Nashirak

« previous php.general (#9098) next »