Jump to content


mysql syntax

  • Please log in to reply
1 reply to this topic

#1 zsxdcfv21

  • Members
  • PipPip
  • Member
  • 14 posts

Posted 30 August 2006 - 06:39 PM

whats the correct way to write this one :

$q = "SELECT n.BuyerNoteID,
date_format(n.Created, '%d %b %y')
FROM BuyerNote n
LEFT JOIN (Buyer b)
ON (b.BuyerID = n.BuyerID
AND b.BuyerID = '{$_GET['BuyerID']}')
LEFT JOIN (User u)
ON (b.UserID = u.UserID)

#2 Barand

  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 30 August 2006 - 07:18 PM

Do you want to

a ) list buyers even if they have no buyerNote or user records
b ) list buyerNotes even if they have no buyer  or userrecord
c ) list only those where there is a match in buyer and buyerNote but not user tables?

etc etc

In other words, we don't know what is correct if we don't jnow what you want to achieve
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received


|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users