This tutorial will show you how to connect to
mysql database. It's easy to write a script to connect to world's most popular
opensource database.
Username = admin
Password = 1234
Database = test
Test
Creating file config.php
Inserting data into mysql
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.
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.
Create table
"test_mysql"
CREATE TABLE `test_mysql` (
`id` int(4) NOT NULL auto_increment,
`name` varchar(65) NOT NULL default '',
`lastname` varchar(65) NOT NULL default '',
`email` varchar(65) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=0 ;
Create file insert.php
Code
Create file insert_ac.php
Code
Delete unwanted data from your mysql database.
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.
Set up database
CREATE TABLE `test_mysql` (
`id` int(4) NOT NULL auto_increment,
`name` varchar(65) NOT NULL default '',
`lastname` varchar(65) NOT NULL default '',
`email` varchar(65) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=7 ;
--
-- Dumping data for table `test_mysql`
--
INSERT INTO `test_mysql` VALUES (1, 'Billly', 'Blueton', 'bb5@phpeasystep.com');
INSERT INTO `test_mysql` VALUES (2, 'Jame', 'Campbell', 'jame@somewhere.com');
INSERT INTO `test_mysql` VALUES (3, 'Mark', 'Jackson', 'mark@phpeasystep.com');
INSERT INTO `test_mysql` VALUES (4, 'Linda', 'Travor', 'lin65@phpeasystep.com');
INSERT INTO `test_mysql` VALUES (5, 'Joey', 'Ford', 'fordloi@somewhere.com');
INSERT INTO `test_mysql` VALUES (6, 'Sidney', 'Gibson', 'gibson@phpeasystep.com');
Create file -
delete.php
Code

Create file
delete_ac.php
Code