RE: [PHP] A PHP UPDATE problem

From: Date: Sun, 09 Mar 2003 15:18:17 +0000
Subject: RE: [PHP] A PHP UPDATE problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-138863@lists.php.net to get a copy of this message
> I am creating a polling system. Its operation likes this: > when the people vote the item, it updates the database by adding 1 for the > item automatically. > The part of code is showed here: > > <?php > $colname_rsAddVote = "1"; > if (isset($HTTP_POST_VARS['Vote'])) { > $colname_rsAddVote = (get_magic_quotes_gpc()) ? $HTTP_POST_VARS['Vote'] : > addslashes($HTTP_POST_VARS['Vote']); > } > mysql_select_db($database_cnTesting, $cnTesting); > $query_rsAddVote = "UPDATE Testing SET GetVotes = GetVotes + 1 WHERE > VoteID > = %s", $colname_rsAddVote); The above line is probably causing an error. You have $var = "string", $var); What are you trying to do? > $rsAddVote = mysql_query($query_rsAddVote, $cnTesting) or > die(mysql_error()); > ?> > In fact, I use Dreamweaver MX to create the page. > But When I run the page, it shows an error. I don't how to reform it. WHAT'S THE ERROR? It helps us tremendously if you actually tell us what the error is, what line it's on, and then show the relevant line with 5 or so lines before it also. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/

« previous php.general (#138863) next »