+ 1

How can I link a database to a web page ??

28th Mar 2017, 8:45 PM
Nasraoui Omar
Nasraoui Omar - avatar
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.
28th Mar 2017, 9:34 PM
Mario L.
Mario L. - avatar
+ 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; } ?>
28th Mar 2017, 9:45 PM
Ryan
Ryan - avatar
+ 1
try this website , it contains almost connections strings ..www.connectionstrings.com
28th Mar 2017, 9:32 PM
ZeroOne;
ZeroOne; - avatar