Hello Vincent, On Friday, March 25, 2005, Vincent Verhagen wrote... > Problem seemed to be table definition; I guess I got the primary keys > wrong which woudl confuse the MySQL REPLACE. Recreated the table from > scratch with cut-and-paste from ../doc/db-backend.txt; problem gone!
> ---------- > I've started experimenting with a MySQL backend to store userprefs. > Created db as recommended in ../doc/db-backend.txt and everything works > fine, but... > Whenever a user changes a preference, the old preference record isn't > changed or deleted, but a new preference record is simply added to the > table. This would make the db grow and grow... I've checked the > ability/rights to delete records; that seems to be in order and I can't > find any errors in the logs related to this issue. > Any ideas? That's certainly interesting. Our code uses REPLACE INTO when using MySQL. The MySQL documentation says: "REPLACE works exactly like INSERT, except that if an old record in the table has the same value as a new record for a PRIMARY KEY or a UNIQUE index, the old record is deleted before the new record is inserted." It also goes on to mention that the user must have INSERT and DELETE privileges on the table, but I dare say it probably wouldn't help to ensure the user has UPDATE privileges too. Did you use our code from doc/db-backend.txt to create the tables? Did you remember to include the PRIMARY KEY code? I think the REPLACE code requires a unique/primary key to work off of to do the update/insert stuff. -- Jonathan Angliss ([EMAIL PROTECTED]) Posting Hints: http://www.squirrelmail.org/wiki/en_US/MailingListPostingGuidelines ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click -- squirrelmail-users mailing list Posting Guidelines: http://squirrelmail.org/wiki/wiki.php?MailingListPostingGuidelines List Address: [email protected] List Archives: http://news.gmane.org/thread.php?group=gmane.mail.squirrelmail.user List Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=2995 List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-users
