Calling functions inside a class from another php class

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
PhpBeginnerr
Forum Newbie
Posts: 1
Joined: Wed Mar 05, 2008 12:24 am

Calling functions inside a class from another php class

Post 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..
Rovas
Forum Contributor
Posts: 272
Joined: Mon Aug 21, 2006 7:09 am
Location: Romania

Re: Calling functions inside a class from another php class

Post by Rovas »

Post Reply