Re: Help w/Error Message

From: Date: Fri, 06 Apr 2001 14:09:49 +0000
Subject: Re: Help w/Error Message
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-47441@lists.php.net to get a copy of this message
Toni Barskile wrote: > > Hi: > > Can someone please explain the following error message? > > ERROR 1052: Column: 'compid' in field list is ambiguous > > Here's my mySQL statement: > > $sql="SELECT fname, lname, compid, status, dept, room, bldg, phone, > ticket_num, compid, date_rpt, request_type, hardware, model, dci, > dci_num,software_type, software_pkg, problem, comments, entered_by > FROM users, tickets > WHERE users.compid = tickets.compid > ORDER BY lname"; > > Thanks in Advance > > Toni > _________________________________________________________________ > Get your FREE download of MSN Explorer at > http://explorer.msn.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net You select from two tables that both have a column named 'compid'. Your computer doesn't know which one of them it should use. So, you should make that decision for 'm: SELECT users.compid or SELECT tickets.compid -- * R&zE: *************************** ** Renze Munnik ** ** E: renze@datalink.nl ** M: +31 6 218 111 43 ***************************

« previous php.general (#47441) next »