php - Get info using table Joins with 2 MySQL tables and DISTINCT -


i have 2 tables: 'bidders' , 'solditems' tables.

the solditems table has 2 columns need use: buyerid , paidstatus. in bidders table, want info columns: bidnum, bidfname, bidlname, bidphnum. (the 'buyerid' values in sold items corresponds 'bidnum' in bidders)

i'm trying unique buyer numbers solditems table paidstatus marked unpaid, , buyers' info (fname, lname, , phnum) bidders table.


this have right now:

select        distinct(i.buyerid),        b.bidfname,        b.bidlname,        b.bidphnum  'solditems'  inner join 'bidders' b on i.buyerid = b.bidnum  i.paidstatus='unpaid'  order i.buyerid asc 

if use in phpmyadmin sql section test it, error says:

1064 - have error in sql syntax; check manual corresponds mariadb server version right syntax use near ''solditems' inner join 'bidders' b on i.buyerid = b.bidnum i.paids' @ line 1

i've never done joins before can't seem working.

changed ' ` symbol columns , ' " string values

select       distinct(i.buyerid),       b.bidfname,       b.bidlname,       b.bidphnum `solditems`  inner join `bidders` b on i.buyerid = b.bidnum  i.paidstatus= "unpaid" order i.buyerid asc 

Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -