Ambiguous Column Name

QuestionsAmbiguous Column Name
Kristopher Baker asked 7 years ago

I found a bug in the in-line search. I have a custom query for the table inner joining two tables, both have a column named "name". When the in-line search attempts to build the query, it errors because of an ambiguous column name. Has anyone run across this before?

5 Answers
Kristopher Baker answered 7 years ago

I found the line of code that causes the error. It looks like the $field variable is just the column name and not the table + column. I don't know if there is a way to pass the table and then concat the two??

$qwery .= "LOWER($field)".$qopers[$op]." LOWER(".$v.")";

Kristopher Baker answered 7 years ago

Also, I found that if you use the select_command and use the select * from (MY STATEMENT) as o, this breaks the in-line search. It doesn't have the proper format for sql. I had to go through and take those out.

Abu Ghufran answered 7 years ago

Hello

All you need is to use following with column definition. This will resolve the name conflict for searching.

$col["dbname"]="table.field";

Kristopher Baker answered 7 years ago

Ok, so that would require me to setup the columns manually and not use the auto-populate option, like I am currently using. I will give it a try.

Abu Ghufran answered 7 years ago

Yes, it is not doable with auto-populate option. You have to go manual way.

Your Answer

18 + 9 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating / 5. Vote count:

We are sorry that this post was not useful for you!

Let us improve this post!