close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

DataAssist Pages wizard does not write the correct query code, "ambiguous error".

Thread began 11/07/2018 6:57 pm by Jonas | Last modified 4/16/2019 11:55 am by Ray Borduin | 228 views | 22 replies |

Jonas

DataAssist Pages wizard does not write the correct query code, "ambiguous error".

It appears that the DataAssist Pages wizard does not write the correct query code. Firstly, it is not written consistently. Sometimes with `` sometimes without. Secondly, it sometimes misses the table name before the column name, which becomes an "amigous" error message.

When I let Querybuilder fix the problem, orders will not be the way I want it. It appears that query builder is based on the order in the database itself. But I have changed this in the DA Pages wizard.

So I have to correct the code, which is a little frustrating to do every time I create new CRUD files using DA.

Below is the code from both Detail page and Results page. Both the wrong code that DA creates and the code that I corrected.

I hope you can add this to your "to-do list" to the next update.

Detail page, DA code with error from browser:

"SELECT id, `llSubject`.`menu_name` AS llSubject_menu_name, llCountry.country AS llCountry_country, `llCategory`.`content` AS llCategory_content, content, landmarkFeature, link1, link2, date, date_update, user_id FROM llPage LEFT JOIN llSubject ON llSubject.id = llPage.subject_id LEFT JOIN llCountry ON llCountry.code = llPage.countryCode LEFT JOIN llCategory ON llCategory.id = llPage.category_id WHERE id = ?

Column 'id' in field list is ambiguous"
--
Detail page, my correct code:

"SELECT `llPage`.`id`, `llSubject`.`menu_name` AS llSubject_menu_name, `llCountry`.`country` AS llCountry_country, `llCategory`.`content` AS llCategory_content, `llPage`.`content`, `llPage`.`landmarkFeature`, `llPage`.`link1`, `llPage`.`link2`, `llPage`.`date`, `llPage`.`date_update`, `llPage`.`user_id` FROM llPage LEFT JOIN llSubject ON llSubject.id = llPage.subject_id LEFT JOIN llCountry ON llCountry.code = llPage.countryCode LEFT JOIN llCategory ON llCategory.id = llPage.category_id WHERE `llPage`.`id` = ?"

-----

Results page, DA code with error from browser:

SELECT id, link2, `llSubject`.`menu_name` AS llSubject_menu_name, llCountry.country AS llCountry_country, `llCategory`.`content` AS llCategory_content, content, date_update FROM llPage LEFT JOIN llSubject ON llSubject.id = llPage.subject_id LEFT JOIN llCountry ON llCountry.code = llPage.countryCode LEFT JOIN llCategory ON llCategory.id = llPage.category_id
--
Results page, my correct code:

SELECT `llPage`.`id`, `llPage`.`link2`, `llSubject`.`menu_name` AS llSubject_menu_name, `llCountry`.`country` AS llCountry_country, `llCategory`.`content` AS llCategory_content, `llPage`.`content`, `llPage`.`date_update` FROM llPage LEFT JOIN llSubject ON llSubject.id = llPage.subject_id LEFT JOIN llCountry ON llCountry.code = llPage.countryCode LEFT JOIN llCategory ON llCategory.id = llPage.category_id

Sign in to reply to this post

Ray BorduinWebAssist

Yes. It is probably not detecting if the same column name exists in both tables. I will update it to always use the table name so that the issue won't occur... Thank you for reporting this issue and solution. I'll add it to my to do list.

Sign in to reply to this post

Justin@AdventDesign

Has this been updated? I'm having the same problem.

Sign in to reply to this post

Ray BorduinWebAssist

I think this should be fixed. Have you reinstalled recently?

Sign in to reply to this post

Justin@AdventDesign

Less than 2 weeks ago

Sign in to reply to this post

Ray BorduinWebAssist

Please attach a copy of the page with the issue. I'll take a look. What is the full error you get?

Sign in to reply to this post

Justin@AdventDesign

This is the current error:

SELECT SQL_CALC_FOUND_ROWS tbl_homes.id AS id, tbl_homes.title AS title, `sl_types`.`title` AS sl_types_title, `sl_categories`.`title` AS sl_categories_title, tbl_homes.sqft AS sqft, tbl_homes.beds AS beds, tbl_homes.baths AS baths, tbl_homes.featured AS featured, tbl_homes.dateupdate AS dateupdate, `sl_publish`.`title` AS sl_publish_title FROM tbl_homes LEFT JOIN sl_types ON sl_types.id = tbl_homes.type LEFT JOIN sl_categories ON sl_categories.id = tbl_homes.category LEFT JOIN sl_publish ON sl_publish.id = tbl_homes.publish WHERE ((`id` = 1) and (`type` = 4) and (`category` = 7) and (`subcategory` = 1) and (`community` = 1) and (`beds` = 1) and (`baths` = 1) and (`garagemin` = 0) and (`garagemax` = 0) and (`publish` = 1)) LIMIT 1000

Column 'id' in where clause is ambiguous

I should note, I've already modified the following query trying to fix the original error, which was a similar ambiguous error. I got the the point where the error is in the 'where' clause, and I don't quite understand how the search query builds that portion. The original before my changes is attached with the "_original" at the end of the name.

Sign in to reply to this post

Ray BorduinWebAssist

I think you should just manually update:

(`id` = 1)

to:

(tbl_homes.`id` = 1)

I don't think the wizard actually does this WHERE clause for you... you may have added it manually? I'll look into it though. Thanks for the information.

There is a preference in WebAssist->Preferences where you can increase the delay while running the wizard. Look in the "Wizard Settings" section.

Sign in to reply to this post

Justin@AdventDesign

See PM

Sign in to reply to this post

Justin@AdventDesign

Where do I find those settings?

Never mind... Just found the "Preferences" under "WebAssist" menu...

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...