+ 1
How can I link a database to a web page ??
3 Answers
+ 5
take a look at tutorials on PHP PDO
it is an object oriented way to do what you want.
otherwise use the mysqli_ functions of php.
+ 2
<?php
function getDatabaseConnection($dbname){
$host = "HOST IP OR LOCALHOST";
$dbname = "NAME OF DATABASE";
$username = "PHPMYADMIN USERNAME";
$password = "PHPMYADMIN PASSWORD
//connecting to the database
$dbConn = new PDO("mysql:host=$host;dbname=$dbname", $username, $password);
//Setting Errorhandling to Exception
$dbConn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
return $dbConn;
}
?>
+ 1
try this website , it contains almost connections strings ..www.connectionstrings.com