Jump to content

Search by page->meta?


Zeka
 Share

Recommended Posts

Only option I know is plain SQL:

<?php
// populate test value
$pages->get(1)->meta('foo', 'foo');

// find pages
$result = $database->query("SELECT source_id FROM pages_meta WHERE name = 'foo' and data = '\"foo\"'");
$ids = implode("|", $result->fetchAll(\PDO::FETCH_COLUMN, 0));
db($pages->find("id=$ids"));

If you use this with user input be sure to properly sanitize the data and maybe use prepared statements!

  • Like 2
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...