I am trying to insert values into a MySQL database called 'todo' I made a PDO connection.
    <?php
 include_once('class.database.php');
 class ManageUsers{
     public $link;
     function __construct(){
         $db_connection = new dbConnection();
         $this->link = $db_connection->connect();
         return $this->link;
     }
     function registerUsers($username,$password,$ip_address,$time,$date){
         $query = $this->link->prepare("INSERT INTO users (username,password,ip_address,time,date) VALUES (?,?,?,?,?)");
         $values = array($username,$password,$ip_address,$time,$date);
         $query->execute($values);
         $counts = $query->rowCount();
         return $counts;
     }
 }
    $users = new ManageUsers();
    echo $users->registerUsers('bob','bob','127.0.0.1','12:00','29-02-2012');
?>
<?php
    class dbConnection{
            protected $db_conn;
            public $db_name = 'todo';
            public $db_user = 'root';
            public $db_pass = 'password';
            public $db_host = 'localhost';
            function connect(){
                try{
                    $this->db_conn = new PDO("mysql:host=$this->db_host;dbname=$this->db_name",$this->db_user,$this->db_pass);
                    return $this->db_conn;
                }
                catch(PDOException $e)
                {
                    return $e->getMessage();
                }
            }
    }
?>
The result should be 1 - i.e. it should add one row into the database. Instead, I get the following error message.
Fatal error: Uncaught Error: Call to a member function prepare() on string in C:\xampp\htdocs\classes\class.ManageUsers.php:15 Stack trace: #0 C:\xampp\htdocs\classes\class.ManageUsers.php(24): ManageUsers->registerUsers('bob', 'bob', '127.0.0.1', '12:00', '29-02-2012') #1 {main} thrown in C:\xampp\htdocs\classes\class.ManageUsers.php on line 15
What have I done wrong?
 
    