rma.eugene Posted May 31, 2010 Share Posted May 31, 2010 Hey All, Any way to combine this ugliness? $query2 = ' Select ' . 'a.BodyLength,' . 'a.ContentType,' . 'a.CreatedById,' . 'a.Name,' . 'a.ParentId,' . 'a.SystemModstamp' . " from Attachment a WHERE ParentId = " . $where; $query3 = 'Select' . 'n.CreatedById,' . 'n.CreatedDate,' . 'n.OwnerId,' . 'n.ParentId,' . 'n.SystemModstamp,' . 'n.Title' . "from Note n WHERE ParentId = " . $where; thanks in advance! Link to comment https://forums.phpfreaks.com/topic/203468-combine-two-mysql-queries/ Share on other sites More sharing options...
premiso Posted May 31, 2010 Share Posted May 31, 2010 $query2 = ' Select ' . 'a.BodyLength,' . 'a.ContentType,' . 'a.CreatedById,' . 'a.Name,' . 'a.ParentId,' . 'a.SystemModstamp,' . 'n.CreatedById,' . 'n.CreatedDate,' . 'n.OwnerId,' . 'n.ParentId,' . 'n.SystemModstamp,' . 'n.Title' . " from Attachment a JOIN Note n ON n.ParentId = a.ParentId WHERE ParentId = " . $where; Link to comment https://forums.phpfreaks.com/topic/203468-combine-two-mysql-queries/#findComment-1065914 Share on other sites More sharing options...
rma.eugene Posted May 31, 2010 Author Share Posted May 31, 2010 thanks! thats what I was looking to do. unfortunately... SoapFault exception: [sf:MALFORMED_QUERY] MALFORMED_QUERY: n.SystemModstamp,n.Title from Attachment a JOIN Note n ON n.ParentId = a.ParentId ^ ERROR at Row:1:Column:176 unexpected token: JOIN in D:\websites.... cant do 'join' with soap client?? Link to comment https://forums.phpfreaks.com/topic/203468-combine-two-mysql-queries/#findComment-1065919 Share on other sites More sharing options...
premiso Posted May 31, 2010 Share Posted May 31, 2010 No clue. Never used the SOAP client. You can try this: $query2 = ' Select ' . 'a.BodyLength,' . 'a.ContentType,' . 'a.CreatedById,' . 'a.Name,' . 'a.ParentId,' . 'a.SystemModstamp,' . 'n.CreatedById,' . 'n.CreatedDate,' . 'n.OwnerId,' . 'n.ParentId,' . 'n.SystemModstamp,' . 'n.Title' . " from Attachment a, Note n WHERE n.ParentId = a.ParentId AND a.ParentId = " . $where; Link to comment https://forums.phpfreaks.com/topic/203468-combine-two-mysql-queries/#findComment-1065920 Share on other sites More sharing options...
rma.eugene Posted June 1, 2010 Author Share Posted June 1, 2010 Sadly... SoapFault exception: [sf:MALFORMED_QUERY] MALFORMED_QUERY: Attachment a, Note n WHERE n.ParentId = a.ParentId AND a.ParentId = 'a045000000CTXumAAH' ^ ERROR at Row:1:Column:203 unexpected token: 'a.ParentId' in D:\websites... Seems like that should have worked. Guess I'll run two queries. shouldn't be too big an issue? thanks Link to comment https://forums.phpfreaks.com/topic/203468-combine-two-mysql-queries/#findComment-1065923 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.