title: Selecting multiple fields using If condition, with left join in mysql - throwing error
body: <p>Any help is appreciated  --</p>
  <h1>1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as receiverimage, re.fName as receiverfName , re.lName as receiverlName , re.add' at line</h1>
  <pre><code>SELECT co.*, 
  if(( co.senderid = 1) , ( re.image as receiverimage, re.fName as receiverfName , re.lName as receiverlName , re.address as receiverAddress , re.city as receivercity , re.state as receiverstate, re.country as receivercountry, re.zipCode as receiverzip),(se.address as senderAddress,se.city as sendercity , se.state as senderstate , se.country as sendercountry , se.zipCode as senderzip , se.image as senderimage ,se.fName as senderfName, se.lName as senderlName )) 
  FROM contacts as co
  LEFT JOIN users as se ON( se.id = co.senderid )
  LEFT JOIN users as re ON( re.id = co.receiverid )
  where (senderid = 1 OR receiverid = 1) 
  </code></pre>
  <p>-- is that selecting multiple fields on join table is not valid with or something else ?</p>
  <p>I am unable to figure out the exact reason , basic prob. here is to select few fields based on if condition from user table based on join.</p>