|
Posted by J.O. Aho on 10/03/77 11:44
Duderino82 wrote:
> nope...same problem...is there any function besisde auot_increment that
> adds 1 to a specific field?
>
If you have problems with
$str="UPDATE $table SET view=view+1 WHERE code=$code";
then you have two possible problems
1. Your php script is run twice
2. your column view has auot_increment enabled
To fix 1, you have to ensure that the script is only loaded once, if you
include the file with the code that counts up the view column, then use
include_once() instead of include().
http://www.php.net/manual/en/function.include-once.php
To fix 2, you will need to use ALTER and remove the auot_increment for the
column view. http://dev.mysql.com/doc/refman/5.0/en/alter-table.html
//Aho
Navigation:
[Reply to this message]
|