Listing by letters of the alphabet
2 posts by 2 authors in: Forums > CMS Builder
Last Post: May 26, 2008 (RSS)
By richo - May 26, 2008
I am a new user of CMS Builder and just getting used to it. It's an excellent product.
I have used the php code to list my data but how can I display all records in the title field that begin with the letter A for example. I want to create a different php page for each letter of the alphabet.
Hope you can help. Many thanks.
John
I have used the php code to list my data but how can I display all records in the title field that begin with the letter A for example. I want to create a different php page for each letter of the alphabet.
Hope you can help. Many thanks.
John
Re: [richo] Listing by letters of the alphabet
By Dave - May 26, 2008
John, welcome to the CMS Builder forum! :)
That's a bit more of an advanced request, but you can do it with a MySQL WHERE statement like this: title LIKE "a%"
So you can either add that in the code generator or to the code itself like this:
Hope that helps! Let me know if you need more details.
That's a bit more of an advanced request, but you can do it with a MySQL WHERE statement like this: title LIKE "a%"
So you can either add that in the code generator or to the code itself like this:
list($newsRecords, $newsDetails) = getRecords(array(
'tableName' => 'news',
'perPage' => 3,
'where' => 'title LIKE "a%"',
));
Hope that helps! Let me know if you need more details.
Dave Edis - Senior Developer
interactivetools.com
interactivetools.com