A PHP UPDATE problem
| From: | Terry Lau | Date: | Sun, 09 Mar 2003 08:00:50 +0000 |
| Subject: | A PHP UPDATE problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-138839@lists.php.net to get a copy of this message | ||
Hello,
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);
$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. Thanks!!
Terry_________________________________________________________________ 今日星座 http://www.msn.com.hk/fortune/west/ 運程