herbally Posted March 18, 2010 Share Posted March 18, 2010 Anyone mind explaining what the "->" portions of the following code do? I've been reading a lot about php in the last few days and have yet to uncover the meaning. Thanks! $results = $this->db->safeQuery('SELECT * FROM mosaic_target WHERE filename="%s" LIMIT 1;', $filename); Quote Link to comment https://forums.phpfreaks.com/topic/195710-newb-syntax-question/ Share on other sites More sharing options...
premiso Posted March 18, 2010 Share Posted March 18, 2010 It is used with objects to access a property or method of an object. See OOP for more information on Object Oriented Programming. Basically $this means it is being used inside the context of an object (generally a class) so it calls itself. db is a property of the object and safeQuery is a method inside of the db property (which is probably an object itself). Quote Link to comment https://forums.phpfreaks.com/topic/195710-newb-syntax-question/#findComment-1028199 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.