Time to get technical. The main point of this blog was to document the advancements I make in developing the Eye Of Midas, and contribute back to the web what I’ve gotten for free for so long. I’m sure there’s tons of resources for what I’m about to explain, but I enjoy doing things from scratch. So, here’s how to build a simple chat program using AJAX and jQuery, in Code Igniter.
First, you’ll need a place to store large amounts of data that you have quick access to. Check it out, MySQL Server does just that!
Create a database and put a table in it called messaging. (You can call it whatever you want, just make sure to change the appropriate fields in the code, later.
CREATE TABLE IF NOT EXISTS `messaging` ( `message_id` int(11) NOT NULL auto_increment, `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP, `channel` varchar(64) NOT NULL, `sender` varchar(64) NOT NULL, `target` varchar(64) NOT NULL, `message` varchar(255) NOT NULL, PRIMARY KEY (`message_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
This builds out a simple table for what we’re going to implement in code.