no more auto increment db fields

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
digininja
Posts: 9
Joined: Fri Feb 18, 2005 11:41 pm
Location: Sheffield, UK

no more auto increment db fields

Post by digininja »

I'm curious why you have removed the auto increment from the id fields in the database. My guess is it is so that you can support databases which don't have auto-increment fields. Am I right?

Are you worried about race conditions? e.g. 2 different INSERTs happening at the same time and both getting the same id. The db wouldn't let it but you would get errors.

Also, while looking at this I've noticed that on lines 47 and 49 (second and third INSERT statements) of save.php you are missing a SQLPREFIX. from the table name.
Thorsten
Posts: 15759
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

yes, you're right. We dropped auto increment and limit because we're supporting now PostgreSQL, Sybase and MS SQL besides MySQL.

I'm not worried about race conditions. PHP and the suported databases are so fast and FAQs never get so many visits so it should be save. But I'll work more on that.

I fixed the bug with the forgotten table prefixes in CVS.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply