Re: multi updates

From: Date: Fri, 07 Sep 2001 00:08:43 +0000
Subject: Re: multi updates
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-66294@lists.php.net to get a copy of this message
where's the form, maybe the problem is there. your update query has no where statment, this isnt syntaxicaly incorrect, its just rare that you need to update every single element in the database to the same value. everything else looks ok, what exactly is the error/warning ? you dont accually need the $conn in mysql_query() and die() is just nasty, I like a little bit more friendly user errors. I also like to shorten things by putting the mysql_query in the if() statement if ( !mysql_query($sql) ) -- Chris Lee lee@mediawaveonline.com "Gary" <gbland@worldnet.att.net> wrote in message news:3B980CEE.3090000@worldnet.att.net... > I have a form that has name (unique in the table), team, pick, and > message. The below is updating all the rows with the same updates. where > have I screwed up? > > > > $sql = "UPDATE cappers SET team= \"$team\", pick = \"$pick\", message > = > \"$message\""; > > //Get Results > $sql_result = mysql_query($sql, $conn) or die("Couldn't Query Database"); > > if(!$sql_result) { > > TIA > Gary >

« previous php.general (#66294) next »