You are here: Re: Counter problem « PHP SQL « IT news, forums, messages
Re: Counter problem

Posted by J.O. Aho on 10/13/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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация