Jump to content

Can't add sort to selector without crazy error


hellomoto
 Share

Recommended Posts

I have

$select = 'template=post, when<=now, sort=when, ';
$results = $pages->find($select);

then output the results' data. It works fine without the sort=when. With it, I get this:

Error: Exception: SQLSTATE[42000]: Syntax error or access violation: 1066 Not unique table/alias: '_sort_when' (in /Applications/AMPPS/www/website/wire/core/PageFinder.php line 384)

:( what is this

I have this elsewhere

$start = date('Y', $pages->get($select.' sort=when')->getUnformatted('when'));

and it works fine, returns the earliest year.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...