download php help :
http://www.php.net/docs.php
that will explain anything about php
install some database server (eg. mysql, oracle, postgree, interbase, etc)
I use WAMP for that (Windows,Apache,MySql,PHP)
2007-02-19 00:11:37
·
answer #1
·
answered by Manzana verde 5
·
0⤊
0⤋
The important thing is which database (MySQL, Oracle...) are you using?
In case of MySQL, you should have something similar
$server = "localhost"; //localhost only if you u are running MySQL on the same maching you are running PHP (using Apache/IIS).
$db_User = "root"; //Or any other user which u can use to connect to db.
$strPassword = "your password";
$strDatabase = "your database";
$link = mysql_connect($server, $db_User, $strPassword);
mysql_select_db($strDatabase);
//To run a query
mysql_query($strQuery, $link);
?>
2007-02-18 21:05:47
·
answer #2
·
answered by Atif Majid 3
·
0⤊
0⤋
$host = 'localhost';
$username = 'root';
$password = 'yourpassword';
$database = 'yourdatabase';
$connect = mysql_connect($host, $username, $password) or die ('Error connecting to mysql');
mysql_select_db($database);
?>
2007-02-18 20:49:34
·
answer #3
·
answered by Mighty Oats 2
·
0⤊
0⤋
// db properties
$dbhost = 'db host name';
$dbuser = 'root';
$dbpass = 'test';
$dbname = 'db name';
?>
$conn = mysql_connect ($dbhost, $dbuser, $dbpass) or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ($dbname);
?>
//mysql_free_result($result);
mysql_close($conn);
?>
2007-02-18 21:29:26
·
answer #4
·
answered by Pearl 2
·
0⤊
0⤋