[eluser]rawoke083[/eluser]
Hi Guys !
Trying to get Datamapper to work with codeignitor 2.0
this is my model
Code:
//file modles/country.php:----------------------------------------
<?php
class Country extends DataMapper {
var $table = 'countries';
// var $has_many = array('provinces'); <-- leave this for now, just get basics up
function __construct($id = NULL)
{
parent::__construct($id);
}
}
?>
Code:
// Controller: controllers/ccountry.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class CCountry extends CI_Controller {
function __construct()
{
parent::__construct();
}
function index()
{
echo "Before";
$my_country = new Country();
echo "after";
}
}
--------------------------------------------------------------------------------------------------------
It doesn't print anything after "Before" no error msg just dies
here is my sql for "counties"
-------------------------
countries | CREATE TABLE `countries` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) DEFAULT NULL,
`country_code` varchar(4) DEFAULT NULL,
`tel_prefix` varchar(2) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1