Hi there,
I’m attempting to use get_where to grab a list of all database records where the owner is equal to the logged in user.
This is my function in my controller;
function files()
{
$owner = $this->auth->get_user();
$this->db->get_where('files', array('owner =' => '$owner'))->result();
}
And in my view I have the follow...
Hi, I want to implement several languages on one site (codeigniter framework). There are four country flags in the design. When user click on any flag the page should load the information in chosen language. There is no registration on the site (The site is quite simple).
I'd like my url's to be like this: http://site.com/en/controlle...
I'm aware of the benefits of using a PHP framework (not first hand though, just by reading SO, etc.) But what I don't hear about is the amount of "unlearning" a framework requires. When using a framework, you hand control to the new framework and you have to "unlearn" many things and re-learn them the new way as your new framework requir...
Hi guys,
I'm running into a I18N-problem here.
I have a database with several variables stored. (e.c. *mod_sales*)
To make my site I18N-able I'm using the language-class of CI-framework to read a line of a language-file
(e.c. *$this->lang->line('mod_sales');* ).
This will return me the value of that language-variable out of the langu...
Hi there I am trying to do a COUNT that has WHERE clauses in it, the code I am using is
function count_tasks($userId) {
$this->db->count_all('tasks');
$this->db->where('tasksAssignedTo', $userId);
$query = $this->db->where('taskPriority_taskPriorityId !=', 6);
return $query;
However Codeigniter only seems to be running the foll...
This article explains how to use Zend in Codeigniter.http://www.beyondcoding.com/2008/02/21/using-zend-framework-with-codeigniter/
I am using XAMPP and having difficulties with path.
Could anyone explain the followings please.
Q1. I am not sure what is going on here. Why do I need to set this one?
ini_set('include_path', ini_get('inc...
I'm building an app with CodeIgniter. My question is how do you combine the database config with a site wide config file? I want to have the config file based outside the application directory so that users will only need to modify one file without digging around inside the application directory.
...
I would like to check if my assumption about codeigniter is right ?
We would normally extend a class when we are trying to include more functionality to the core, such as MY_Controller extends Controller, MY_Model extends Model etc...
But for example, if we are in the checkout library retrieving some checkout info(eg, product_id), we c...
Background
I use the word widget as a partial view that have its own controller (so its own actions) and it is placed in almost all pages. I implement the rendering of this via HMVC, that is just great.
Problem
Now, the problem is that the widget itself execute actions. Think about a shopping cart widget. That widget is placed in all ...
Did Codigniter have inbuilt javascript lib?
else what javascript framework best for Codigniter
...
I'm just learning codeigniter, and I seem to have run into something that is a little strange. I'm using the URI routing feature but need to get the URI segments of the re-routed URI.
This is one of the routes:
$route['content'] = "site/display/main template/content";
and when visiting http://lipsum.localhost/content it loads the con...
I'm wondering if there's a way to dump all of the values of
$this->session->userdata()
so I can troubleshoot?
I'm working within Facebook, and have a login page, and once that's successful I want to pass around the UID of the current user, and I thought this would work well.
I currently have the uid set as follows:
require_once '...
I have a function that generates a key of 4 characters that has to be unique for each time. In order to do that, the function first generates a key, and then checks a database table to see if it's in use by someone else.
If it's not in use, it returns the key, else, it calls itself again, but this causes the function to do an infinite l...
Hi friends,
I use CodeIgniter, I'm happy with that, but I have a question.
I build my projects under /www/projectname/beta/... directory, so at my code, at many parts like including some images or css files or etc. I have to make ... src="/projectname/beta/... so when I complete the website, I need to edit so many pages to clear these...
I just inherited a project because the last developer left. The project is built off of Code Igniter. I've never worked with Code Igniter before.
I took a quick look at the code and I see database calls in the controller like this:
$dbResult = $this->db->query("SELECT * FROM users WHERE username = '".$_POST['user_name']."'");
or c...
Previously using Ocular 0.25 I was able to set an object as a view data, that I could access in the view: like:
$b= new book(); $b->get_where("id",5);
$this->ocular->set_view_data("b", $b);
//could be accessed in view as $b
but in the new Ocular 1.0.1, when I try to set a data mapper object it gives me a blank screen, without an...
hi y'all,
I wanted to ask, I have a div that I would want to place RSS feeds from the BBC or CNN. Now that works but I wanted to paginate the feeds that come in, display 5 at a time with the others showing when the links are clicked. I am starting to write the code now but I was hoping I would get either inspiration or have an example I...
Hello,
In my CI system\libraries directory I have a new class named DD_Controller.php. This file looks like this:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class DD_Controller extends Controller
{
protected $ddauthentication;
function __construct()
{
parent::Controller();
...
hi guys,
I have something weird going on here. I just finished a site for a client and I uploaded and I can reach the site no problem. I have a tab on the site where you click a collapsing tree and click on a topic and it calls up an article from a db. On my local development platform (xampp vista) this works nicely but once I uploaded ...
Hi friends,
I researched over the internet, but could not find anything...
I have a mysql db, and records at a table, and I need to get random record from this table at every page load. how can I do that? Is there any func for that?
Appreciate! thanks
SORTED:
link: http://www.derekallard.com/blog/post/ordering-database-results-by-r...