You need to have a connection to mysql before
you can send and recieve data. This first code will define the DB
variables, so you will need to enter all of your database info!
Connecting
to a Database
You need to have a connection to mysql before you can send and
recieve data. This first code will define the DB variables, so
you will need to enter all of your db info!
| CODE |
<?php
$localhost ="localhost";
$dbuser="your_db_name";
$dbpass= "your_db_pass";
$dbname = "your_db_name";
|
This next code is the code that you´ll need to make the
connection. You don´t need to set the variables again
| CODE |
mysql_connect($localhost, $dbuser, $dbpass) or die
(mysql_error());
@mysql_select_db ("$dbname") or
die(mysql_error());
|
Thats all, but don´t forget this: ?> ;)
|