Welcome Guest, Not a member yet? Register   Sign In
DataMapper ORM (PULLING MY HAIR OUT !!)
#1

[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);
    }

}
?&gt;


Code:
// Controller: controllers/ccountry.php

&lt;?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


Messages In This Thread
DataMapper ORM (PULLING MY HAIR OUT !!) - by El Forum - 02-18-2011, 01:39 AM
DataMapper ORM (PULLING MY HAIR OUT !!) - by El Forum - 02-18-2011, 02:02 AM
DataMapper ORM (PULLING MY HAIR OUT !!) - by El Forum - 02-18-2011, 02:09 AM
DataMapper ORM (PULLING MY HAIR OUT !!) - by El Forum - 02-18-2011, 02:31 AM
DataMapper ORM (PULLING MY HAIR OUT !!) - by El Forum - 02-18-2011, 02:54 AM
DataMapper ORM (PULLING MY HAIR OUT !!) - by El Forum - 02-18-2011, 09:47 AM



Theme © iAndrew 2016 - Forum software by © MyBB