delete comments and users
chanifel - July 2, 2008 - 11:22
| Project: | Flag content |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
There is a mistake in the query of deleting comments and users in function function flag_content_comment and function flag_content_user, the mistake is wrong use of apostrophe around %s
the solution is changing the apostrophe into inverted commas
the correct query is: 'DELETE FROM {flag_content} WHERE eid = %d AND type = "%s"'

#1
This is the correct SQL delimiter for char type. There is no problem with using '%s' at all.
Are you using PostgreSQL? What error are you getting that makes you think this is a problem.
#2
The query is incorrect because it's using "eid" and not "fid".
#3
Actually, I'm not really sure what's going on.
Your .install file uses fid and eid. Your DELETEs use eid.
But the generated table I get is:
+--------------+----------------------+------+-----+---------+----------------+| Field | Type | Null | Key | Default | Extra |
+--------------+----------------------+------+-----+---------+----------------+
| fcid | int(10) unsigned | NO | PRI | NULL | auto_increment |
| fid | smallint(5) unsigned | NO | MUL | 0 | |
| content_type | varchar(32) | NO | MUL | | |
| content_id | int(10) unsigned | NO | | 0 | |
| uid | int(10) unsigned | NO | | 0 | |
| timestamp | int(10) unsigned | NO | | 0 | |
+--------------+----------------------+------+-----+---------+----------------+
#4
This appears to be caused by Flag and Flag Content being installed at the same time.