Begin with the connection between php and mysql.
It has a template that loads all the friends of userID 666. It uses a connect.php and a friendship.php
This commit is contained in:
13
website/queries/connect.php
Normal file
13
website/queries/connect.php
Normal file
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
$dbconf = simplexml_load_file("/var/mysql_config.xml");
|
||||
if ($dbconf === FALSE) {
|
||||
die("Error parsing XML file");
|
||||
}
|
||||
else {
|
||||
$db = new PDO("mysql:host=$dbconf->mysql_host;dbname=$dbconf->mysql_database;charset=utf8",
|
||||
"$dbconf->mysql_username", "$dbconf->mysql_password")
|
||||
or die('Error connecting to mysql server');
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user