Sorry, don't know Jugas database structure but your queries look a bit off. Please see following examples (I don't know table names so adjust as necessary!).
[code:1]
INSERT INTO `#__juga_u2g` ( `user_id`, `group`, `date` ) VALUES ( [user_id], 4, NOW() );
[/code:1]
You should always specify the columns just to be safe. If an additional column was added and you did not specify columns it would completely offset your inserts or cause them to fail entirely. Also notice the "quotes" around tables and columns.
- is that the proper use of [user_id]?
Yes
- can I use the #__ table prefix? Or do I need the real prefix?
Yes
[code:1]
DELETE FROM `#__juga_u2g` WHERE `user_id` = [user_id] AND `group_id` = 4;
[/code:1]
Limit generally doesn't work on delete queries and will just error. Either further clarify your delete WHERE statement or let it delete everything from that user.
Post edited by: krileon, at: 2010/06/14 14:54