Search code examples
phpzend-frameworkzend-db

zend db fetchRow return trouble


I'm coding up a page to show all data related to an item and I'm pulling up nulls when I try to access the data returned by this query.

DB::call()->setFetchMode(Zend_Db::FETCH_ASSOC);
$query = "SELECT name, release_date, points, availability, exclusivity, original_price,     sold_at, designer, model
    FROM items 
    WHERE item_id = '$id'";
$row = DB::call()->fetchRow($query);
$this->name = $row['name'];
//Same with other fields

DB is just a wrapper class for Zend_DB left by a previous programmer. I've ran the exact same query in PHPmyAdmin to make sure that it pulls up results. I'm assuming that my problem is how I'm trying to access the return data, since I'm not very familiar with Zend Framework. How should I be trying to access the data?


Solution

  • My query was invalid because the id being passed in was null. I simply have my routes set up incorrectly.