3068 Posts in 868 Topics by 650 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 677 Views |
-
Tell me whats wrong with this query?

14 December 2009 at 11:22pm
Hey guys,
A quick post, hopefully you can point me in the right direction.
$QueryTag = 'New Article';
$RelatedArticles = DataObject::get('ArticleManagerArticle','`ArticleManagerArticle`.`Title` = \''.$QueryTag.'\'');
//Returns ArticleManagerArticle->Title = "New Article"$QueryTag = '%Article%';
$RelatedArticles = DataObject::get('ArticleManagerArticle','`ArticleManagerArticle`.`Title` = \''.$QueryTag.'\'');
//Returns nothingI would have expected that the Query would have easily pulled the "New Article" title again?
The application for this is just to call related articles to a Sidebar.
-
Re: Tell me whats wrong with this query?

15 December 2009 at 9:13am
Try using `ArticleManagerArticle`.`Title` LIKE '%Article%' (Or LIKE '%Article') rather then the =.
| 677 Views | ||
|
Page:
1
|
Go to Top |


