Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-06-2007, 10:56 AM   PM User | #1
urgido
Regular Coder

 
Join Date: Aug 2005
Posts: 257
Thanks: 8
Thanked 0 Times in 0 Posts
urgido is an unknown quantity at this point
ambiguous

When I tried to run my script, this error is showing:

PHP Code:
ErrorColumn 'profile_field_id' in from clause is ambiguous
    in query
"SELECT `field`.*, `match_field_name`.`name` AS `matching`, `match_field`.`match_type` AS `matching_type` FROM `date_profile_field` AS `field` LEFT JOIN `date_link_profile_field_match` AS `match_field` ON `field`.`profile_field_id`=`match_field`.`match_profile_field_id` LEFT JOIN `date_profile_field` AS `match_field_name` USING ( `profile_field_id` )" 
Regards
urgido is offline   Reply With Quote
Old 02-06-2007, 01:39 PM   PM User | #2
guelphdad
Super Moderator


 
guelphdad's Avatar
 
Join Date: Mar 2006
Location: St. Catharines, Ontario Canada
Posts: 2,629
Thanks: 4
Thanked 147 Times in 138 Posts
guelphdad will become famous soon enoughguelphdad will become famous soon enough
Don't use USING at any time. It isn't standard SQL.
name the tables.columns you are joining those tables on.
guelphdad is offline   Reply With Quote
Old 02-07-2007, 10:19 AM   PM User | #3
urgido
Regular Coder

 
Join Date: Aug 2005
Posts: 257
Thanks: 8
Thanked 0 Times in 0 Posts
urgido is an unknown quantity at this point
so, the solutions is just delete the USING phrase?
urgido is offline   Reply With Quote
Old 02-07-2007, 06:31 PM   PM User | #4
guelphdad
Super Moderator


 
guelphdad's Avatar
 
Join Date: Mar 2006
Location: St. Catharines, Ontario Canada
Posts: 2,629
Thanks: 4
Thanked 147 Times in 138 Posts
guelphdad will become famous soon enoughguelphdad will become famous soon enough
the solution is to remove the USING clause and use an ON clause with the appropriate columns named from both tables that you are joining on.
guelphdad is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:32 PM.


Advertisement
Log in to turn off these ads.