DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Some Php

06.23.2010
| 887 views |
  • submit to reddit
         $masterDB = Database::getInstance( 'live_core' );
    $limit = self::MAX_URLS_PER_PAGE + $this->booksReleasedForPage;

    $q = $masterDB->prepare('select biblio_id from rental_catalog rc left join seo_tiers st using(biblio_id) where rc.renting=1 and st.biblio_id is null limit 100');
    $q->execute();
        echo "doing stuff\n" ;

    while ($rows = $q->fetch(PDO::FETCH_ASSOC))
    {
        if (is_null($rows['biblio_id'])) {
                echo "biblio_id was null.";
                next;
        }
        echo "biblio_is id not null. updating.";
        $qry = $masterDB->prepare("UPDATE seo_tiers SET tier=4 where biblio_id = $id");
        $qry->execute();
    }
echo "done with that.\n";

    $q = self::$sitemapDB->prepare('SELECT biblio_title.title, seo_tiers.tier, biblio.isbn
FROM (biblio_title INNER JOIN biblio ON biblio_title.biblio_id = biblio.id)
 INNER JOIN seo_tiers ON biblio.id = seo_tiers.biblio_id ORDER BY tier, isbn');