Re: PHP Add +1 mysql updates by 2?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Nov 26, 2010, at 8:36 PM, Richard West wrote:

Hey guys,
I've never run into this before.
I have a field in mysql for page views.
So I pull out value and do +1 to new value - after UPDATE SET it has incremented by 2?

$val = $row['a_downloads'] ;

$new_val = $val+1;

mysql_query("UPDATE cbn_articles SET a_downloads='$new_val' WHERE a_id = '".$_GET['id']."' ");

Any ideas? What am I missing?
RD

a_downloads wouldn't happen to be an autoincrement value, would it?



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux