Log in

View Full Version : Fatal error: Call to a member function query() on a non-object



queerfm
07-13-2009, 05:00 AM
Hi i need to find out what this error is

Fatal error: Call to a member function query() on a non-object in /home/*****/public_html/beta/system/articals/artical.php on line 15

the code is


<?php
require_once("configuration.php");
$vconfig = new VConfig();

$dbData = new DBData("localhost","$vconfig->user","$vconfig->dbpass","$vconfig->db");


class DBData extends DBConnect{

public function title(){
$result=$DBData->query('SELECT * FROM push_content');
$row=$result->fetch_assoc();
//echo user's password
print $row['title'];

}


}


?>


There is something wrong with this $result=$DBData->query('SELECT * FROM push_content');

but from what i have worked out its something wrong with the $result=$DBData->query

If any one can help that would be great.
Thanks

onestopplay
07-13-2009, 10:40 AM
shouldn't it be mysql_query(SELECT....);

queerfm
07-13-2009, 10:42 AM
Not when you are using OOP (object orientated Program)
You can use the old php way or the new OOP/OOD