Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Incompatibilities with Auth & PDO
  • I was playing around with the auth package today, and came across an interesting mysql error that told me to check the syntax of my query. After a good half hour of banging my head against the wall, it occurred to me what the problem was. PDO Is a cross-database driver. It's meant to work with pretty much anything, and as such it follows standards by *not* encapsulating column names in back ticks. Normally, that isn't an issue - but what if the column name happened to be something like SELECT, or some already reserved word. You'd have a problem. Well, the auth package uses the table name 'group', which as you can see in http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html , is a reserved word (Note that the reserved words are case-insensitive). This means that any function in the auth package which uses the group column will cause an MySQL error when used with the PDO driver. My first thought was to just do a replace all in my application and consider it dealt with, but then I realized that this is a somewhat larger issue with the upcoming deprecation of the MySQL driver. So I thought I'd bring up the issue here and see what a better solution could be, in hopes of getting it changed in the fuel core. My personal idea would be to have fuel automatically prepend all column names with the name of the table (users_group), but I'm not sure that would be the best fix.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!