1. Create a Database (name: test):
root@localhost# mysqladmin -u root -ppass create cmysql_mset
Database "cmysql_mset" created.
2. We enter as administrators for MySQL in the "mysql" Data Base and execute the following
sentences, which will create a control user for the test.
root@localhost# mysql -u root -ppass mysql
mysql> GRANT insert, select, update, delete
-> ON cmysql_mset.*
-> TO cmysql_mset@localhost
-> IDENTIFIED BY 'cmysql_mset';
Query OK, 0 rows affected (0.01 sec)
3. We change to the cmysql_mset database
mysql> use cmysql_mset;
Database changed
mysql>
4. We create the structure for the database and we introduce some registers in order
to make the tests.
mysql> CREATE TABLE test (
-> id tinyint(3) unsigned NOT NULL auto_increment,
-> nombres char(15) NOT NULL,
-> PRIMARY KEY (id),
-> KEY id (id),
-> UNIQUE id_2 (id)
-> );
Query OK, 0 rows affected (0.00 sec)
mysql> INSERT INTO test VALUES( '1', 'Markitos');
Query OK, 1 row affected (0.00 sec)
mysql> INSERT INTO test VALUES( '2', 'Pepito');
Query OK, 1 row affected (0.00 sec)
mysql> INSERT INTO test VALUES( '3', 'Juanito');
Query OK, 1 row affected (0.00 sec)
mysql> quit
Bye
test.php to see the funcions of the class
|