Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 24,628
» Latest member: totoonlineresmi
» Forum threads: 73,483
» Forum posts: 375,924

Full Statistics

Latest Threads
Class not found
Forum: General Help
6 hours ago
» Replies: 0   » Views: 35
CodeIgniter v4.1.2 releas...
Forum: News & Discussion
8 hours ago
» Replies: 11   » Views: 425
Databases: searching for ...
Forum: General Help
8 hours ago
» Replies: 10   » Views: 321
ci_session cookie rejecti...
Forum: CodeIgniter 4 Support
8 hours ago
» Replies: 7   » Views: 3,491
update(null,$data)
Forum: CodeIgniter 4 Support
9 hours ago
» Replies: 1   » Views: 48
get and post filtering fo...
Forum: CodeIgniter 4 Discussion
10 hours ago
» Replies: 5   » Views: 127
Swith to object oriented ...
Forum: General Help
10 hours ago
» Replies: 10   » Views: 585
The requested URL was not...
Forum: Addins
11 hours ago
» Replies: 0   » Views: 40
No sessions in testing en...
Forum: CodeIgniter 4 Support
11 hours ago
» Replies: 3   » Views: 41
Looking for CI developer ...
Forum: Jobs
11 hours ago
» Replies: 2   » Views: 88

 
  How to Remove Index.php
Posted by: El Forum - 06-30-2007, 06:52 AM - Forum: Archived Development & Programming - Replies (2)

[eluser]Thananjeyan[/eluser]
Hiii

I now only entered to code igniter. one problem that is

Now i stored my .htaccess file in codeigniter folder...

How to Remove index.php from my url. If you Knows help me....

I have used this code on .htaccess file in my codeigniter folder.

Code:
RewriteEngine on
RewriteBase /
RewriteCond $1 !^(index\.php|robots\.txt|css|images|jscript)
RewriteRule ^(.*)$ /index.php/$1 [L]

I am using local Xampp server.

I got one error message from my Browser

Server error!

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.


  logging database queries
Posted by: El Forum - 06-30-2007, 04:23 AM - Forum: Archived Development & Programming - Replies (3)

[eluser]Unknown[/eluser]
Been looking at db_debug and stuff like that, but I don't find and obvious way to log all database queries to a file.
In fact I wan't only to log any query that modifies the database.

Any suggestions on how to achieve this?

All my application code uses actice record so I was thinking of extending that class, so the methods that imply update, insert, delete would log the SQL query automtically. But since the active record class is not a library, I don't believe I can extend it in the application/libraries folder the standard way.
How can I avoid modifying the CodeIgniter source and still achieve this?
An I don't want to rely on manualy adding logging statements in the controller code itself.


  Cannot query database in custom_helper?
Posted by: El Forum - 06-30-2007, 02:50 AM - Forum: Archived Development & Programming - Replies (3)

[eluser]java[/eluser]
I have a function placed in custom_helper file :

Code:
function getCityName($id)
{
    $query = $this->db->getwhere('thanhpho', array('ThanhPhoID' => $id));
    $row = $query->row();
    return $row->Ten;
}
i want it automatically called in my view. But the view generated error:
Quote:Fatal error: Call to a member function on a non-object in d:\www\hoahau\system\application\helpers\custom_helper.php on line 181
and line 181 is my query command in function above.
What's the wrong in my code? Please tell.
Thanks for any response


  .htaccess problems
Posted by: El Forum - 06-30-2007, 12:32 AM - Forum: Archived General Discussion - Replies (4)

[eluser]vwenberg[/eluser]
I am having problems with setting .htaccess. I have followed the directions in the wiki and I get a 500 Internal Server Error. Looking at my error log, I get the following:

Code:
[Sat Jun 30 00:48:29 2007] [error] [client 192.168.2.2] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to  increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

I don't know much about mod_rewrite so I don't know where to begin.


  '/' is giving problem in url routing
Posted by: El Forum - 06-30-2007, 12:05 AM - Forum: Archived Development & Programming - Replies (4)

[eluser]Unknown[/eluser]
hi,

I’m new to CI and i am working on CI from past 5 months..

i am getting problem with '/' in url routing

the following routes are working fine on windows os.

$route['^archives/cu/cat_index.html$'] = "archives/cat_index";
$route['^archives/([A-Za-z_]+)/([0-9]+)/([A-Za-z_]+).html$'] = "archives/cu";
$route['^archives/([A-Za-z_]+)/([A-Za-z]+)_index.html$'] = "archives/cu";
$route['^archives/([A-Za-z_]+)/([0-9]+)_index.html$'] = "archives/cu";

$route['^articles/([0-9]+),([0-9]+),([0-9_]+),([0-9]+),([0-9]+),([0-9]+).html$'] = "archives/articles_display";
$route['^articles/(daily)/([0-9]+),([0-9_]+),([0-9]+),([0-9]+),([0-9]+).html$'] = "archives/articles_display";
$route['^articles/(newsletter)/([0-9]+),([0-9_]+),([0-9]+),([0-9]+),([0-9]+).html$'] = "archives/articles_display";

but same routes are not working in linux os..
but if i put '/' at the end of url (ex.. www.xxx.com/index.html/) it is working

but for my page ranking i can't put '/' at the end.

please help........


  Howto share code?
Posted by: El Forum - 06-29-2007, 04:39 PM - Forum: Archived Libraries & Helpers - Replies (3)

[eluser]AmazingMinds[/eluser]
I've got a snippet of code (a library) for the ignited framework, which can compare 2 tagclouds and I was wondering where (and how!) I could share those with the community. Are there any restrictions as to packaging/coding/documenting practices, etc?


  No results when paginate (WHERE something=$something)
Posted by: El Forum - 06-29-2007, 04:06 PM - Forum: Archived General Discussion - Replies (1)

[eluser]Gabriel P[/eluser]
Hello,

I wish to grab some articles from db WHERE parentid=$catid. The thing is i want to paginate them. So, i believe i did not write the correct code.

Here is my function from the controller:

Code:
function showArtByCat($catid)
    {  
        $data['base_url'] = $this->config->item('base_url');
        
        $data['cats'] = $this->Catmodel->getCats();
        $data['subcats'] = $this->Catmodel->getSubCats($catid);
        $data['catname'] = $this->Catmodel->getCatName($catid);
        
        
        $query = $this->db->query("SELECT COUNT(*) AS count FROM articles WHERE (parentid=".$catid.")");
        $row = $query->row();
        $total_rows = $row->count;

        $per_page = 10;
        $this->db->use_table('articles');
        $this->db->limit($per_page);
        
        if ($this->uri->segment(3) !== FALSE)
        {
            $this->db->offset($this->uri->segment(3));
        }          
        $data['query'] = $this->db->get();

        $config['base_url'] = 'my_base_url';
        $config['total_rows'] = $total_rows;
        $config['per_page'] = $per_page;

        $this->pagination->initialize($config);
        $data['paginate'] = $this->pagination->create_links();
        
        $this->load->view('front/cat', $data);
    }

Could somebody help me? I think i`m tired and i can`t figure it out.

Thanks,
Gabriel


  More apps like Bamboo Invoice ?
Posted by: El Forum - 06-29-2007, 02:53 PM - Forum: Archived General Discussion - Replies (1)

[eluser]CI shocki[/eluser]
Hi guys,

Personally I have learned quite alot form Derek Allards "Bamboo Invoice". If anybody has something similar please share it. Would be nice to have some public source codes.

Thanks alot.
Regards Jan...


  [Fixed]
Posted by: El Forum - 06-29-2007, 01:41 PM - Forum: Archived Development & Programming - No Replies

[eluser]Unknown[/eluser]
Got it figured out!


  Question about CI_Base class
Posted by: El Forum - 06-29-2007, 10:35 AM - Forum: Archived Development & Programming - Replies (2)

[eluser]Michael Ekoka[/eluser]
I noticed that the CI_Base class forks for the 2 versions:

This is the v5 CI_Base content:

Code:
class CI_Base {

    private static $instance;

    public function CI_Base()
    {
        self::$instance =& $this;
    }

    public static function &get_instance()
    {
        return self::$instance;
    }
}

function &get_instance()
{
    return CI_Base::get_instance();
}
now this is v4:
Code:
class CI_Base extends CI_Loader {

    function CI_Base()
    {
        // This allows syntax like $this->load->foo() to work
        parent::CI_Loader();
        $this->load =& $this;
        
        // This allows resources used within controller constructors to work
        global $OBJ;
        $OBJ = $this->load; // Do NOT use a reference.
    }
}

function &get_instance()
{
    global $CI, $OBJ;
    
    if (is_object($CI))
    {
        return $CI;
    }
    
    return $OBJ->load;
}

My question is the following, is there a particular reason why we couldn't adapt v4 CI_Base to emulate v5 like this. This is strictly out of technical curiosity. I'm not a php4 expert, I use php5 mostly, so I'm a bit shady with the pass by reference syntax in php4, feel free to correct.
Code:
class CI_Base {

    function CI_Base()
    {
        self::instance(& $this);
    }
    
    function instance($i=null){
        static $instance;
        if($i){
            $instance = $i;
        }
        return $instance;        
    }
    
    function &get_instance()
    {
        return self::instance();
    }
}

function &get_instance(){
    return CI_Base::get_instance();
}



  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.