cforms II User Forum

Registration is currently disabled.
Guest

FAQs

Login form protected by Login LockDown.


Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

    

Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
[bug] DB name should be enclosed in backticks?
October 25, 2007
3:57 am
anatman
Guest

Hey,

Thank you for your nice plugin.

I suppose i have a bug, when activating the plugin i get this:

WordPress database error:
[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 '-_wordpress LIKE 'acup_cformssubmissions'' at line 1]
SHOW TABLES FROM taijiquan_pro_br_-_wordpress LIKE 'acup_cformssubmissions'

This usually happens to me when i don't enclose my DB's name in backticks, due to the hyphen in it's name (which is  taijiquan_pro_br_-_wordpress).  I would try to fix it myself, but if this is the case during the activation the bug may be spread throughout the code everywhere the name is referenced, right?

Sorry for being nosy and throwing a wild guess like this one.

Thanks,

Eduardo (anatman) 

 

 

October 25, 2007
7:30 am
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

You guessed right Eduardo, I think I have not used backticks anywhere in the code. As a work around you could just search in all the *.php files for

$wpdb->

and modify where necessary (shouldn't too many).

On second thought, the code producing this line:

show tables like '$wpdb->cformssubmissions'") == $wpdb->cformssubmissions

doesn't even reference your table directly, so you may need to specifically include the "FROM.." in those "show tables" statements.

October 29, 2007
8:30 am
anatman
Guest

Hey Oliver,

Thank you for your help.  I think i found the culprit: line 142 in lib_functions.php references the DB_NAME directly.  I just don't know how to fix the thing, i am not a programmer.  Enclosing DB_NAME in backticks obviously didn't work.

Do you know how to fix this?  I will be gratefull! 

October 29, 2007
5:07 pm
anatman
Guest

Ok, a little bit of sleep and i fixed it, hehe, just need to put the backticks inside the quotes that come before and after DB_NAME. Now the plugin is activated correctly!

 Thanks a lot for your help!

Smile

October 29, 2007
8:50 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

Glad you got it sorted out, I'll adjust the code for v5.53.

Forum Timezone: Europe/Berlin

Most Users Ever Online: 959

Currently Online:
21 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

tracedef: 43

mores: 21

Gyrus: 20

frozenwaste: 18

asuffredini: 15

photoworks: 14

Member Stats:

Guest Posters: 3757

Members: 1463

Moderators: 3

Admins: 2

Forum Stats:

Groups: 1

Forums: 4

Topics: 5355

Posts: 18732

Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass

Moderators: Paul (421), cnymike (8), sonika (95)

Administrators: Oliver (6400), Nicky (3)