Run MySQL (the best combination with PHP ). EXEMySQL (the best combination with PHP) & gt; createdatabasecounter; QueryOK, 1 rowaffected (0.10sec) MySQL (the best combination with PHP) & gt; usecounter; databasechangedMySQL (best combination with PHP)
Run MySQL (the best combination with PHP). EXE
MySQL (the best combination with PHP)> create database counter;
Query OK, 1 row affected (0.10 sec)
MySQL (the best combination with PHP)> use counter;
Database changed
MySQL (best combination with PHP)> create table tl (id integer (2), count integer (5 ));
Query OK, 0 rows affected (0.21 sec)
MySQL (best combination with PHP)> show columns from tl;
+ ------- + -------- + ------ + ----- + --------- + ------- +
| Field | Type | Null | Key | Default | Extra |
+ ------- + -------- + ------ + ----- + --------- + ------- +
| Id | int (2) | YES | NULL |
| Count | int (5) | YES | NULL |
+ ------- + -------- + ------ + ----- + --------- + ------- +
2 rows in set (0.05 sec)
MySQL (the best combination with PHP)> select * from tl;
Empty set (0.08 sec)
MySQL (best combination with PHP)> insert into tl (id, count) values );
Query OK, 1 row affected (0.02 sec)
MySQL (the best combination with PHP)> select * from tl;
+ ------ + ------- +
| Id | count |
+ ------ + ------- +
| 1 | 1 |
+ ------ + ------- +
1 row in set (0.03 sec)
Write the following HTML file content:
$ Myvar = "visitors :";
Echo $ myvar;
?>
MySQL (the best combination with PHP) _ connect () or die ("there are problems to connect to MySQL (the best combination with PHP )! ");
$ Query = "select * from tl ";
$ Result = MySQL (the best combination with PHP) _ db_query ("counter", $ query );
If ($ result ){
$ R = MySQL (the best combination with PHP) _ fetch_array ($ result );
$ Counter = $ r ["count"];
$ Counter = $ counter + 1;
Echo $ counter;
$ Query = "update tl set count = $ counter where id = 1 ";
$ Result = MySQL (the best combination with PHP) _ db_query ("counter", $ query );
MySQL (the best combination with PHP) _ close ();
}
?>