i have written a simple class for OOP in mysql and php and when i tested if even if the values that i used also in my normal connection process is the same the mysql won't connect me to it.. this is my class:
<?php
class DBlink{
protected $link,$dbname,$uname,$passw,$db,$hname;
function __construct($u='root',$p='',$d='web',$h='localhost'){
$this->uname = $u;
$this->passw = $p;
$this->db = $d;
$this->hname = $h;
$this->link=mysql_connect($hname,$uname,$passw);
$this->db = mysql_select_db($this->db);
}
function nonquery(){
echo '<p>your name is ' . $this->hname .' '.$this->uname .' '. $this->passw .'</p>';
}
}
$a = new DBlink();
$a->nonquery();
unset($a);
?>
anyone who has an idea my it gives me an ODBC error?