Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-30-2007, 04:45 PM
Junior Member
 
Join Date: Jul 2007
Posts: 11
Default fetchAll works, but fetchOne and fetchRow do not...

Hello! I'm having some difficulties getting fetchOne() and fetchRow() to work. Here's my code..
$sql = "SELECT Count(*) as row_count FROM $table_name $where";
$row_count = $this->db->fetchOne($sql);
The error I get is: Fatal error: Call to undefined method DB_mysql::fetchOne()

If I change it to fetchAll(), it works just fine.

Any ideas?

Thanks!
- Bret
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 10-30-2007, 04:48 PM
Junior Member
 
Join Date: Jul 2007
Posts: 11
Default

Nevermind! I figured it out.
$sql = "SELECT Count(*) as row_count FROM $table_name $where";

$this->db->setFetchMode(DB_FETCHMODE_ASSOC);
$row_count = $this->db->getOne($sql);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 07:50 AM.