Structure Database |
|
|
|
|
To continue, we need to understand the structure of a database. In the above example, the database is called vantage; in this database are: Calls two data tables: data and MiniMaxidata. So we'll connect to the base
vantage data and plot the values ??found in the tables
|
|
|
|
1.- Start by creating a directory
where you will put the login script and graphics.. |
|
Just a reminder:
to create or edit PHP files, you should use Notepad + + or PSPad
for with syntax coloring is much easier
missed by lines of code. |
|
|
|
|
2 .- Open a blank page in
your text editor and copy and paste the text below: |
|
|
|
<?php
$server ="localhost";
$user="your_user_name";
$pass="password";
$db="the_name_of_the_database";
mysql_connect($server,$user,$pass) or die ("Erreur SQL : ".mysql_error()
);
mysql_select_db($db) or die ("Erreur SQL : ".mysql_error()
);
?> |
|
You must change the parameters "" are in red top
1. Server: localhost set as normally the script is installed on the same server
2. specify the user = username defined for the database
3. pass = Enter the password you set for your database
4. db = specified only the name of the database
|
The file should
look like this: |
|
Save the file with php extension, eg mysql_connect.php |