January 2009

You are currently browsing the monthly archive for January 2009.

Codeigniter

While i was talking to mehmet ,he mentioned about php frameworks.  I heard somethings about them but not realy knew what they do.

After some research i found codeigniter. Codeignter is an open source php framework. You can use it to make faster, easier web applications. Also it has rich php library. To understand how it works , you can watch video tutorial of Codeigniter from here

This code gets all information from your database table named category

$data['query'] = $this->db->get(‘category’);

To get last 2 data i used only this code:

$data['query'] = $this->db->get(‘category’,2);

Codeigniter makes up a form for your database tables to instert your data, you don’t have to write any mysql, and html code :)

i hope you like it

Related posts

Tags: , , ,

mysql_insert_id

mysql_insert_id() is a very usefull function..

what does it do ?

it returns id generated from previous insert query.

Could you give some example ?

mysql_query("insert into product (name) values(aflower)");
if you want to print id of "aflower" you can use mysql_insert_id
echo mysql_insert_id();

!: to use mysql_insert_id your cloumn should be an auto_increment cloumn

Related posts

Tags: , , ,

On ubuntu and kubuntu systems you can install php5 apache2 mysql and phpmyadmin with this command

sudo apt-get install apache2 php5 php5-mysql php5-gd mysql-server phpmyadmin

To enable mod_rewrite run this:

sudo ln -sfn /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/
sudo /etc/init.d/apache2 restart

Related posts

Tags: , , , , , ,