jeger003 Posted February 4, 2009 Share Posted February 4, 2009 hello, i recently purchased a script and im trying to make sense of its code to hopefully change it around im a newbie so i was hoping some can explain to me what these mean elseif ($session_result->RecordCount() == 1) what does the '->' mean? $this->page_id = 22; $this->get_text($db); if ($this->classified_user_id) { $this->sql_query = "select * from ".$this->listings_table." where seller = ".$this->classified_user_id." and live = 1 order by date desc"; what does '$this->' mean? echo $show->BOLDING." is classified BOLDING<Br>\n"; and finally what does this "$show->" mean and why would it need to echo is classified BOLDING? i searched google php.net and a few other places and cant understand these things i would appreciate links to source that would help or a small explanation Quote Link to comment Share on other sites More sharing options...
trq Posted February 4, 2009 Share Posted February 4, 2009 Take a look here. Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted February 4, 2009 Share Posted February 4, 2009 That is a class. In most languages they use a '.' but PHP uses a '->' instead. Quote Link to comment Share on other sites More sharing options...
jscix Posted February 4, 2009 Share Posted February 4, 2009 -> and :: are simply ways to access a property or function of an object. $this refers to the current object. $show is an instance of an object. $show->BOLDING, is either accessing a method, or property on '$this' Quote Link to comment Share on other sites More sharing options...
jeger003 Posted February 4, 2009 Author Share Posted February 4, 2009 Awesome! It gets really confusing when they look like variables but are not defined. Thanks so much for the help guys! thanks for the link thorpe.........it helps A LOT when there are examples of how its used or can be used. 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.