Re: Why isn't this working?
| From: | Richard Lynch | Date: | Sun, 30 Jun 2002 21:59:47 +0000 |
| Subject: | Re: Why isn't this working? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-104760@lists.php.net to get a copy of this message | ||
In article <20020628125957.61236.qmail@pb1.pair.com> , webmaster@tececo.com
(Jj Harrison) wrote:
>Here is my code:
>
>$query = "UPDATE poll_options SET votes + 1";
>mysql_query($query);
>
>All where conditions have were removed to try and fix the problem
Dunno...
Why aren't you asking the database what went wrong? :-)
mysql_query($query) or die(mysql_error());
Actually, you'd be better off to use:
mysql_query($query) or error_log(mysql_error());
and then check your HTTP error logs, assuming your ISP provides them.
You can leave this error-checking code in there, and always leave a trail
for yourself of what went wrong when where. Keeping or die() on a
production web-site is a security risk.
Oh, actually, now that I re-read the post, I do know what's wrong in this
case:
update poll_options set VOTES = votes + 1
^^^^^^^
This is missing ---------/
--
Like Music? http://l-i-e.com/artists.htm