We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Does Query Module Allow MySQL Functions?

Development and Programming

wikitect's avatar
wikitect
136 posts
15 years ago
wikitect's avatar wikitect

I want to place the following in a exp:query tag

SELECT REPLACE(page_name,"_"," ") As wiki_title, UCASE(page_namespace) As page_namespace, page_name
FROM exp_wiki_page
ORDER BY exp_wiki_page.last_updated DESC
LIMIT 5

The idea being to return the last 5 wiki entry updates but having a title that can be used in a hyperlink i.e. one that doesn’t have the “_” underscore to separate the words.

I know the SQL is valid but within the EE query tag it throws an error. Is it that the query tag doesn’t like SQL functions?

       
ender's avatar
ender
1,644 posts
15 years ago
ender's avatar ender

are you using double quotes around the query for the sql parameter?

{exp:query sql="query goes here"}

If so, you’ll need to replace your double quotes within the REPLACE function with single quotes.

       
wikitect's avatar
wikitect
136 posts
15 years ago
wikitect's avatar wikitect

Indeed I was - so busy looking for the hard reasons that I forgot to look for the obvious!

Many thanks

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.