Getting error message:
user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 7 query: CREATE TABLE user_badges_badges ( bid int(10) NOT NULL default '0', name varchar(50) NOT NULL default '', image varchar(80) NOT NULL default '', weight int(2) NOT NULL default '0', href VARCHAR(80) default '', ) in /var/www/vhosts/REMOVED.org/subdomains/ALSOREMOVED/httpdocs/includes/database.mysql.inc on line 174.
think it was probably :
case 'mysqli':
db_query("CREATE TABLE {user_badges_badges} (
bid int(10) NOT NULL default '0',
name varchar(50) NOT NULL default '',
image varchar(80) NOT NULL default '',
weight int(2) NOT NULL default '0',
href VARCHAR(80) default '',
)");
changed it to
case 'mysqli':
db_query("CREATE TABLE {user_badges_badges} (
bid int(10) NOT NULL default '0',
name varchar(50) NOT NULL default '',
image varchar(80) NOT NULL default '',
weight int(2) NOT NULL default '0',
href VARCHAR(80) default ''
)");
in install file, and it seemed to work after that.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | user_badges.install.txt | 3.71 KB | snailian |
Comments
Comment #1
will kirchheimerthat is I removed the comma at end of : href VARCHAR(80) default '',
Comment #2
chadchandler commenteduser warning: Table 'myname_drpl1.user_badges_badges' doesn't exist query: SELECT DISTINCT b.bid, b.weight, b.name, b.image, b.href FROM user_badges_badges b INNER JOIN user_badges_user u ON b.bid = u.bid WHERE u.uid = 1 ORDER BY b.weight, b.name in /includes/database.mysql.inc on line 172.
Also happens in dev version ... is there a simple fix?
Comment #3
skkd commentedsame problem here..
user warning: Table 'XXX_drupaldb.user_badges_badges' doesn't exist query: SELECT DISTINCT b.bid, b.weight, b.name, b.image, b.href FROM user_badges_badges b INNER JOIN user_badges_user u ON b.bid = u.bid WHERE u.uid = 181 ORDER BY b.weight, b.name in /home/XXX/domains/arabolge.org/public_html/includes/database.mysql.inc on line 174.
line 174 of database.mysql.inc:
trigger_error(check_plain(mysql_error($active_db) ."\nquery: ". $query), E_USER_WARNING);
any idea?
Comment #4
snailian commentedI have attached an updated user_badges.install file (just remove the .txt extension) and upload it to the proper location. The comma mentioned in the first post is the source of the error.
Disable the module and re enable it and that should fix the problem.
Alternatively, run this code in mysql to create the table.
CREATE TABLE user_badges_badges (
bid int(10) NOT NULL default '0',
name varchar(50) NOT NULL default '',
image varchar(80) NOT NULL default '',
weight int(2) NOT NULL default '0',
href VARCHAR(80) default '')
Comment #5
idontunderstand commentedStray,
Thank you very much. I will give it a try and let you know if it works.
Stray. I uploaded the install file to replace the one in the existing module but i still got the same problem. When you said to put it in the mysql database, where do I actually put it? Thanks for your help again.
Chris
Comment #6
idontunderstand commentedfixed, i uninstalled the module and put the new code in that you gave me and it works but now i am trying to figure out how i can attach it to different profiles
Comment #7
idontunderstand commentedany luck anyone with this?
Comment #8
xayberoptix commentedThanks for clearing this up. Shouldn't it be included into a new version?
Comment #9
Richard Blackborder commentedThis bug isn't around any more.