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

MAX function broken in $DB class?

Development and Programming

DEA's avatar
DEA
257 posts
16 years ago
DEA's avatar DEA

Hi, I’ve come across troubles using the MAX function in the exp:query tag in the past. But now I’ve come across similar weirdness using the $DB class directly. I had a query like so in an extension:

SELECT MAX(entry_date) FROM mytable...

The query itself was working, as . But it would spit out a MySQL 1064 error regardless, where the entire erroneous query output for debugging was an enigmatic ‘1’. And because of this it would interrupt another extension (SAEF Redirect) after so the whole process just died. (FYI, I did indeed play with the priority settings for each).

Is there some kind of return happening deep and dark inside the class itself when MAX is called? I’ve had to rejig my query to suit and it’s kind of ugly now.

       
Greg Aker's avatar
Greg Aker
6,022 posts
16 years ago
Greg Aker's avatar Greg Aker

DEA:

Shouldn’t be a problem, a quick global find on the EE Source code shows using that, among other places on line 1258 of core.functions.php.

I’m going to shift this down to the Extensions forums, as it’s a better fit.

Thanks!

-greg

       
DEA's avatar
DEA
257 posts
16 years ago
DEA's avatar DEA

Er, hmmm. OK, I hadn’t capitalized ‘max’ in my query. Now that I have it works. What the…?

       

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.