Problem with none object property

Reply

Join Date: Jul 2008
Posts: 39
Reputation: god_1896 is an unknown quantity at this point 
Solved Threads: 0
god_1896 god_1896 is offline Offline
Light Poster

Problem with none object property

 
0
  #1
Jul 30th, 2008
hi all;

what is wrong with in this code, please correct it

thanks

  1. <?php
  2. $value="";
  3. $city="";
  4. echo $result=city::getDisplayName($value->id==$city);
  5. ?>
Last edited by Tekmaven; Jul 30th, 2008 at 9:55 am. Reason: Code tags
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 100
Reputation: petr.pavel is an unknown quantity at this point 
Solved Threads: 14
petr.pavel's Avatar
petr.pavel petr.pavel is offline Offline
Junior Poster

Re: Problem with none object property

 
0
  #2
Sep 4th, 2008
Hi there,
you're treating $value as if it were an object while it is in fact a string "".
You cannot write $value->id unless you first assign an instance of an object to $value.
Petr 'PePa' Pavel

The more information you give the more relevant answer you get.
Please consider using "Add to ... Reputation" and mark your thread as Solved if you found what you were looking for. By giving feedback you help others.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC