g'day, Am having a bit of a problem with using IF. This is the error message I get:
----- SELECT rac.name AS race, IF ( el.entityType =1, ch. * , npc. * )charData FROM characters AS ch, entityLocation AS el, races AS rac, npc AS npc WHERE el.entityType IN ( 1, 10 ) AND el.containerType =6 AND el.containerID =75402 AND IF ( el.entityType =1, el.entityID = ch.characterID AND el.visibility <=60 AND ch.raceID = rac.raceID AND ch.handle <> 'Khan', el.entityID = npc.npcID AND el.visibility <=60 AND npc.raceID = rac.raceID ) LIMIT 0 , 30 MySQL said: #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 '* , npc. * )charData FROM characters AS ch, entityLocation AS ----- What I want to do is select everything from characters if the el.entityType is 1, else I want to select everything from npc table. Cheers, Keith