mysql

You are currently browsing articles tagged mysql.

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: , , , , , ,

Q. How do I change MySQL root password under Linux, FreeBSD, OpenBSD and UNIX like operating system over ssh / telnet session?

A. Setting up mysql password is one of the essential tasks. root user is MySQL admin account. Please note that Linux / UNIX login root account for your operating system and MySQL root are different. They are separate and nothing to do with each other (indeed some admin removes root account and setup admin as mysql super user).
mysqladmin command to change root password

Read the rest of this entry »

Related posts

Tags: , , , ,