SQL Auto Increment Row not incrementing

  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

I have the following SQL

SQL Code: [ Select ]
INSERT INTO `table_sessions` (`sessionID`, `userID`, `groupID`, `userAgent`, `currentLocation`, `session_id`) VALUES ('null', '2', '1', 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101027 Ubuntu/10.10 (maverick) Firefox/3.6.12', '/var/www/Projects/CMS/login.php?page=index.php', 'ccc91fc9d265952ec3af00748bbf1006')

Notice how I set the column "sessionID" to 'null'... it's always '0' in the database even though I have sessionID set to auto increment.

Funny thing is, that sessionID was incrementing and got to '30' (Means I logged in 30 times...) but now after I changed the value to 'groupID' from '0' to '1', it puts the zero into 'sessionID'...

I've also tried that with the following SQL

SQL Code: [ Select ]
INSERT INTO `table_sessions` (`sessionID`, `userID`, `groupID`, `userAgent`, `currentLocation`, `session_id`) VALUES (NULL, '2', '1', 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101027 Ubuntu/10.10 (maverick) Firefox/3.6.12', '/var/www/Projects/CMS/login.php?page=index.php', '05601548706ea806e2fcf522f187483b')


(No quotes around the null), and it still doesn't increment.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

Another weird situation.

I just echo'ed the SQL making the headers to be sent so instead of redirecting me to index.php it threw me the 'headers already sent' error, after I pressed the submit value.

After this I checked the SQL table to see how it was and it auto-incremented... it was at 34...

Ok, good. Problem solved some how, even though I didn't do anything to fix it. I remove the echo which echo'ed the SQL, logged out, logged back in and checked the table.

It was back at 0... ...

I did that a couple of times... seems to me that the only time it increments when the page doesn't redirect... what's going on here?

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 68 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.