What would be the correct format for this? I would like to see if tid IS NULL and if so leave out the last WHERE statement and not get anything from tsms table.
[code=mysql] $sql = "SELECT * FROM users INNER JOIN tsms WHERE id='".$_REQUEST[2]."' ".
"IF(tid NOT NULL) THEN AND tsms.uid=tid END IF";[/code]
[code=mysql] $sql = "SELECT * FROM users INNER JOIN tsms WHERE id='".$_REQUEST[2]."' ".
"IF(tid NOT NULL) THEN AND tsms.uid=tid END IF";[/code]
Comment