I have some custom functions that I store in a helper in CodeIgniter.
Some of those functions need to use the database, and to do so you have to explicitly tell the function to load the Code Igniter framework and database class.
Its pretty simple when you know how, but it took quite a while to work it out.
function get_user_full_name($userId) { //the database functions can not be called from within the helper //so we have to explicitly load the functions we need in to an object //that I will call ci. then we use that to access the regular stuff. $ci=& get_instance(); $ci->load->database(); //select the required fields from the database $ci->db->select('firstName, lastName'); //tell the db class the criteria $ci->db->where('userId', $userId); //supply the table name and get the data $query = $ci->db->get('user'); //ensure that there is something in the variable - in case of no match $fullName = ""; foreach($query->result() as $row): //get the full name by concatinating the first and last names $fullName = $row->firstName . " " . $row->lastName; endforeach; // return the full name; return $fullName; }
This is actually much easier than any of the guides I found online make out.
A few weeks ago I wrote a blog post about using jQuery and JSON to automatically load data from a JSON file in to name-matched controls on an HTML page.
In order to get some of our 32 bit applications working on Windows 7 64 bit edition, we need to provide support for the
I have been using Ubuntu 9.10 for a while and wanted to see how it performs as a web server. The GUI interface is very slick and it is an ideal OS for beginners and advanced users alike. I suspect that many people will want to use it as the basis for their webservers.
When everything has finished installing, I suggest rebooting. There are ways of starting the servers without rebooting, but a reboot works just as well and is much easier.
We now need to let your computer know that it IS mysite.local. The easiest way to do this is to edit your hosts file. There is plenty of information 

I have recently started using Notepad2 again.