SJamG Posted February 13, 2008 Share Posted February 13, 2008 Hi There, I have a website, which uses a script to syncronise properties from one site to another, this is done by a number of PHP scripts, when i add the RSS URL into the PHP script (ezrsync.php), it generates the following error : Fatal error: Call to a member function on a non-object in /homepages/24/d227024453/htdocs/ezrsync.php on line 154 I have attached the zip that contains all the files that should do the job (its probable really simple!) Thanks for any help [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
trq Posted February 13, 2008 Share Posted February 13, 2008 Please post a few lines prior to and including line 154 of ezrsync.php. Quote Link to comment Share on other sites More sharing options...
SJamG Posted February 13, 2008 Author Share Posted February 13, 2008 Hi There, Here are the lines before 154 : $count = 0; foreach ($returnedElements_item as $item) { //Getting the item values @$title = $item->getElement('title'); $title = $title->getValue(); //Check if isn't already added this item if (!is_already_added($title)) {//End: Check if isn't already added this item @$lw_address = $item->getElement('lw:address'); $lw_main_region = $lw_address->getAllChildren('lw:main_region'); Attached is the PHP file itself Thanks [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
PHP Monkeh Posted February 13, 2008 Share Posted February 13, 2008 I'm wondering why the some of the variables have error surpressing. Remove the @s before @$title = $item->getElement('title'); and @$lw_address = $item->getElement('lw:address'); Quote Link to comment Share on other sites More sharing options...
SJamG Posted February 13, 2008 Author Share Posted February 13, 2008 Thanks for the suggestion, Unfortunately, its not made any difference, its still giving me the error : Fatal error: Call to a member function on a non-object in /homepages/24/d227024453/htdocs/ezrsync.php on line 154 Thanks anyway, any other suggestions welcome. Quote Link to comment Share on other sites More sharing options...
trq Posted February 13, 2008 Share Posted February 13, 2008 Which is line 154? Quote Link to comment Share on other sites More sharing options...
SJamG Posted February 13, 2008 Author Share Posted February 13, 2008 Line 54 is : $lw_main_region = $lw_address->getAllChildren('lw:main_region'); Hope this helps. Quote Link to comment Share on other sites More sharing options...
trq Posted February 13, 2008 Share Posted February 13, 2008 I would suggest that $item->getElement('lw:address') is not returning an object, hence $lw_address is not an object, so you can't try and call a method via it. Without looking at more of the code (which I can't from here at work), I wouldn't really be able to help much. Are you sure lw:main_region is a valid element? Quote Link to comment Share on other sites More sharing options...
SJamG Posted February 13, 2008 Author Share Posted February 13, 2008 Thanks for the reply, thorpe, I dont really know much about php, I commissioned the work and now the person has gone AWAL & left us in the lurch! If you have time later, I would really appreciate it if you could have a look at the code in full (attached on first post in ZIP file) Thanks kindly. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.