We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40758
    • 17 Posts
    revo 2.24
    IIS7.5/MS SQL

    I know running SQL is not preferred in revo, but I have no direct access to the database and need to check something quick.

    Something with the alias/uri is messed up, every time I turn on friendly url, navigation links some works some doesn't even show up.

    I'm trying to run SQL to check for duplicate aliases
    select alias, count(alias) as 'duplicate' from dbprefix_site_content group by alias having (count(alias) > 1);


    xPDOCriteria looks to be what I need to use, I just can't figure out how to use it.
    $query = "select ....";
    $criteria = new xPDOCriteria($modx, $query);
    


    The difficult I have is how do I get the value from the query?
    It is a single integer result, not a collection.

    Thanks for reading.
      • 28215
      • 4,149 Posts
      The $modx object extends xPDO, which extends PDO:

      http://us.php.net/PDO

      All methods on PDO, such as ->query, ->exec, etc are available to $modx
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com