Deleting data From mysql

Syntax

“DELETE FROM table_name WHERE column_name=’ value’ “;

In this tutorial create 2 files
1. delete.php
2. delete_ac.php

Step
1. Create table “test_mysql” in database “test”.
2. Create file delete.php.
3. Create file delete_ac.php. Read the rest of this entry »

Leave a Comment

Updating data in mysql

Syntax

“UPDATE table_name SET column_name1=’ value’, column_name2=’ value’ WHERE column_name=’ value’ “;

In this tutorial create 3 files
1. list_records.php
2. update.php
3. update_ac.php

Step
1. Create table “test_mysql” in database “test”
2. Create file list_records.php
3. Create file update.php
4. Create file update_ac.php

Read the rest of this entry »

Leave a Comment

Selecting data From mysql

Syntax

// Select all columns from all rows.
“SELECT * FROM table_name”;
or
// Select some column from all rows.
“SELECT column_name1, column_name2 FROM table_name”;
or
// Select all coulumns from one row.
“SELECT * FROM table_name WHERE column_name=’ value in column ‘”;

In this tutorial create 1 file
1. select.php

Step
1. Create table “test_mysql” in database “test”.
2. Create file select.php.
3. test it!

If you don’t want looping rows in mysql, replace
while($rows=mysql_fetch_array($result)){
……..
<?php
}
mysql_close();
?>

replace with this
$rows=mysql_fetch_array($result);
………
<?php
mysql_close();
?>

Read the rest of this entry »

Leave a Comment

Inserting data into mysql

Syntax

“INSERT INTO table_name(column_name1, column_name2)VALUES(‘value1, ‘value2′)” ;

In this tutorial create 2 files
1. insert.php
2. insert_ac.php

Step
1. Create table “test_mysql” in database “test”.
2. Create file insert.php.
3. Create file insert_ac.php.

Read the rest of this entry »

Leave a Comment

Connecting to MySQL database

Syntax

mysql_connect(“host”, “username”, “password”)or die(“cannot connect to server”);

Overview

Define your database information, in this example use information of www.phpeasystep.com

* host=”localhost” you don’t have to change it. When it’s on your computer or server it still be localhost

Username = phpeasystep
Password = 1234
Database = test
Read the rest of this entry »

Leave a Comment

Introduction to MySQL database

MySql is a powerful database. It’s very good and free of charge. Many developers in the world selected mysql and php for developing their website.

The MySQL® database has become the world’s most popular open source database because of its consistent fast performance, high reliability and ease of use. It’s used in more than 6 million installations ranging from large corporations to specialized embedded applications on every continent in the world. (Yes, even Antarctica!)

Not only is MySQL the world’s most popular open source database, it’s also become the database of choice for a new generation of applications built on the LAMP stack (Linux, Apache, MySQL, PHP / Perl / Python.) MySQL runs on more than 20 platforms including Linux, Windows, OS/X, HP-UX, AIX, Netware, giving you the kind of flexibility that puts you in control.

Whether you’re new to database technology or an experienced developer or DBA, MySQL offers a comprehensive range of certified software, support, training and consulting to make you successful.

Read the rest of this entry »

Leave a Comment