|
From: Patrick C. <pa...@we...> - 2010-03-05 17:53:01
|
Message: 2 Date: Wed, 03 Mar 2010 11:40:44 +0100 From: John Crisp <jo...@re...> Subject: Re: [Vtigercrm-developers] Select queries Finally got the answer myself but don't understand why ! John Crisp wrote: > > $sql = "select accountname from vtiger_account, vtiger_contactdetails > where vtiger_account.accountid = vtiger_contactdetails.accountid and > vtiger_contactdetails.contactid =".$myctc_id; > $result = $adb->query($sql); > $the_acct_name = $adb->query_result($result,0,'accountname'); > >>The answer is changing SELECT accountname to SELECT * >>Can anyone explain it ?? I think it is because your make a join so you must precise the tablename in your select fields or sql can be confused... eg: $sql = "select vtiger_contactdetails.accountname from vtiger_account.... Patrick CARLE _______________________________________________ Reach hundreds of potential candidates - http://jobs.vtiger.com |