Hey all...I am trying to setup an OO model with my DB connections, and I am having some issues. Here is the content from my DB.php include:
############################
class Connection {
Function Connection ($username="nod", $password="12xafloc") {
$this->username=$username;
$this->password=$password;
$db = mysql_pconnect("localhost", "$username", "$password") or die("Could Not connect to DB");
return $db;
}
Function SelectDB ($dbName) {
$select_db = mysql_select_db($dbName) or die("Could not select DB");
}
############################
Here is the file trying utilize:
############################
include "DB.php";
$db = new Connection();
//$db->SelectDB("nod");
$query = "SELECT * FROM links";
$result = mysql_query($query, $db) or die("Could not complete database query");
############################
When running the application "http://www.nod.to", it only prints "Could not complete database query".
Looking at mysql logs, it is creating the DB connection, but not executing the query.
Any thoughts?
Thanks,
Darren