close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Strange error I have no idea of how to deal with

Thread began 8/20/2012 6:57 pm by mrs | Last modified 8/21/2012 9:35 am by Morgan | 1225 views | 5 replies |

mrs

Strange error I have no idea of how to deal with

'Column 'fld_id' in field list is ambiguous' with pages created using Data Assist from Data Bridge

The files it's happening on are the details page and the results list. What's going on here then?

I have narrowed it down to the drop down menu where I used the fld_name for the labels, but I used the fld_id for the values... it's these that it considers ambiguous, but I have no understanding of why, especially when the DB settings for it are INT, 11, UNSIGNED, PRIMARY KEY which is pretty standard for a key column in MySQL.

If I use the fld_name for both labels and values, then the error disappears.

Any thoughts?

I've attached the files affected in a zip file.

Attached Files
ambiguous error.zip
Sign in to reply to this post

Jason ByrnesWebAssist

the problem is in the where clause:
WHERE fld_id

and in the beginning of the select clause:

SELECT fld_id

since the field fld_id exists in both the tbl_bgimg and tbl_menu tables, you need to specify which one to use:
SELECT tbl_bgimg.fld_id.....WHERE tbl_bgimg.fld_id.....


to prevent this issue from happening, i recommend a naming convention that will not allow for duplicate names of columns.

the naming convention I like to follow is to use the table name in the column name.

for example, if i where to create a users table:

users:
userID
userFirstName
userLastName
etc....

or an addresses table:
addresses:
addressID
addressFirstName
addressLastName
etc...

Sign in to reply to this post

mrs

Ah, OK. Thanks for the tip.

Sign in to reply to this post

Morgan

Hi, i took alook at your pages, so i just wanna check 2 things with you.

In your SQL you have this:

"SELECT fld_id, fld_image, `tbl_menu`.`fld_name` AS tbl_menu_fld_name, fld_date, fld_show FROM tbl_bgimg LEFT JOIN tbl_menu ON tbl_menu.fld_id = tbl_bgimg.fld_page WHERE fld_id = %s"

My question is in the SQL query you made: "AS tbl_menu_fld_name" what is the use of that?

Same in your other query too.
"SELECT fld_id, fld_image, `tbl_menu`.`fld_name` AS tbl_menu_fld_name, fld_show FROM tbl_bgimg LEFT JOIN tbl_menu ON tbl_menu.fld_id = tbl_bgimg.fld_page";"`

I would check the SQL query again if i would you, cos there is something there that mySQL aint can read and execute right.

/Morgan

"And as i saw now Jason staded in his post :)"

Sign in to reply to this post

Jason ByrnesWebAssist

Morgan,

in the query:
`tbl_menu`.`fld_name` AS tbl_menu_fld_name


is used to create an alias for the `tbl_menu`.`fld_name`

instead of having to reference it as:
`tbl_menu`.`fld_name`

the alias renames the column in the result to:
tbl_menu_fld_name

Sign in to reply to this post

Morgan

Originally Said By: Jason Byrnes
  Morgan,

in the query:
`tbl_menu`.`fld_name` AS tbl_menu_fld_name


is used to create an alias for the `tbl_menu`.`fld_name`

instead of having to reference it as:
`tbl_menu`.`fld_name`

the alias renames the column in the result to:
tbl_menu_fld_name  



Jason thank you for the reminder :) I figer that after a few mins; alias creating :P

//Morgan

Sign in to reply to this post

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...