Update db.php

Added $ret = new stdClass(); on line 82
Fixed function get_count on line 230. $where=array()