Welcome, Guest
Please Login or Register.    Lost Password?

MySQL Field Names with Dashes
(1 viewing) (1) Guest
Welcome to the ToolsJX forum!


Go to bottomPage: 1
TOPIC: MySQL Field Names with Dashes
#259
MySQL Field Names with Dashes 5 Months, 3 Weeks ago Karma: 0
It appears TableJX doesn't like MySQL database field names with dashes/hyphens in them.

I spent several hours debugging one table that wouldn't display any data at all, while other tables displayed okay.

The problem was a dash (- hyphen character) in the field name. I used phpMyAdmin to replace it with an underscore (_ character) and it worked okay after that.

Maybe something to add to the list for the next revision?
RoadHazard
Fresh Boarder
Posts: 9
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#260
Re:MySQL Field Names with Dashes 5 Months, 3 Weeks ago Karma: 1
You should avoid using dashes in column names also according to many books about DBs.

Joe Celko - SQL For Smarties (page 6)
"Standard SQL allows you to use spaces, reserved words, and
special characters in a name if you enclose them in double
quotation marks, but this should be avoided as much as
possible."

There are several reasons, just one could be:

select a-b
from table

- (minus) is normally used for operator

Best regrads,
Viljem
viljem
Admin
Posts: 145
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#262
Re:MySQL Field Names with Dashes 5 Months, 3 Weeks ago Karma: 0
Good advice. It's just not the way my data happened to be delivered, and it took awhile to figure out the problem.

It might be useful to make a note in the documentation that dashes are not supported/recommended by TableJX and must be changed, even if your MySQL database does support them.
RoadHazard
Fresh Boarder
Posts: 9
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1
Tools JX, Powered by Joomla!; Joomla templates by SG web hosting