php - MySql incrementing field with value 0 (zero) -


hy,

i have problem when try increment 1 field column of type int(11) has value 0 (zero).

here query : update cars set number = number+1 carid='$carid'

the problem if value of number 0 result of increment 2. other values increment works fine.

any ideas? in advance.

later edit: problem not mysql query. guess have bug in code. create pages dynamically (everything goes through index.php file , use require_once include files) , problem appears when access page first time or make ctrl + f5 refresh. have rewrite rules in .htaccess file.

rewriterule ^cars/([0-9]+)/([^\n]+)\.html index.php?page=cars&carid=$1&title=$2 [nc,b,l]  rewritecond %{the_request} /index\.php\?page=cars&carid=([0-9]+)&title=([^\n]+)\ http/ rewriterule ^index\.php$ http://www.cars.com/cars/%1/%2.html? [r=301,nc,l] 

any ideas that?

it looks common noobish rewrite problem.

most people set rewrite to make index.php act 404 handler.

so, if there missed request, it's being redirected index. , let's talk of favicon.ico...

to solve issue have dramatically limit index.php activity. should check right parameters , issue 404 otherwise.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -