Page 1 of 1

Calling functions inside a class from another php class

Posted: Wed Mar 05, 2008 3:58 am
by PhpBeginnerr
Hi,

I am trying to insert decoded Feed into the database.

For that i have created a class called feedAccess and function called insertFeed withinit in a php file called data_access.php.

Now, i wanna call this function from another php file and insert values in the database.

So i include the first php file as
include_once('data_access.php');

then i create a function which has initialization of objects for feedaccess class
function feedInit()
{
//Create object for feedDB access
$this->feedLinksDB = new feedAccess();
$this->feedLinksDB->__construct();
}

and now i call insertFeed function from the class feedAccess() by
$tmp=$this->feedLinksDB;
$returnAdd = $tmp->insertFeed($this->title,
$this->title, $this->link);

This code is working fine on my machine...but when i uploaded this files it on with our hosting datacenter ...It is not calling this function...and code is not executed after this line and doesnt return any error also...

Can anyone help upon this...

Your help for this phpbeginnerr is greatly appreciated...

Thanks in advance..

Re: Calling functions inside a class from another php class

Posted: Wed Mar 05, 2008 4:46 am
by Rovas