Hi all,
i made web service using this extention
http://www.yiiframework.com/extension/restfullyii/
anyone plz help me to get the count of total no of records in a table
this is may data table
CREATE TABLE IF NOT EXISTS places (
id int(60) NOT NULL AUTO_INCREMENT,
name varchar(255) NOT NULL,
discription text NOT NULL,
image varchar(255) NOT NULL,
city_id int(60) NOT NULL,
hotel_id int(60) NOT NULL,
catagory_id int(60) NOT NULL,
type_id int(60) NOT NULL,
latitute float NOT NULL,
longtute float NOT NULL,
metadata text NOT NULL,
PRIMARY KEY (id),
UNIQUE KEY id (id),
KEY city_id (city_id),
KEY hotel_id (hotel_id),
KEY catagory_id (catagory_id),
KEY type_id (type_id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=16 ;
i use this paser for get list of places related with id in TypePlaces table(API controller)
switch($_GET[‘model’])
{
case 'places': // {{{
//get list of places related with id in TypePlaces table
//http://localhost/TheGuidersite_service/index.php/api/Places?typeplacesid=1
if (isset($_GET['typeplacesid']))
{
$Criteria = new CDbCriteria();
$Criteria->condition = sprintf("type_id = %s", $_GET['typeplacesid']);
$models = Places::model()->findAll($Criteria);
}
but now i ned get number of places related with type_id how count this ![]()