hc Posted September 19, 2006 Share Posted September 19, 2006 I am in a bit of a bind, and am hoping someone would take a few minutes to explain this syntax. Basically, I responded to an ad and got hired. They said they needed an MS Access, ASP Programmer, and this is what I got handed to work on. So, I just want to know what this syntax is, particluarly the bolded parts. Any help would be appreciated. I understand that it returns an array of values, but what do the <<< and -> mean?? Thanks...I know this is simple stuff function GetEmployers() { $retval = false; $sqlstr = [b]<<<[/b] SQL SELECT emp.id, emp.employer, sport.id AS job_type_id, sport.name AS jobtype FROM businesses.employers AS emp LEFT JOIN master.sports AS sport ON sport.id = emp.sport_id WHERE emp.status_id = 1 ORDER BY emp.employerSQL; if([b]$this->Load[/b]($sqlstr)) { while($row = $this->db->fetch()) { $retval[] = $row; } } return $retval; } // GetEmployers() Link to comment https://forums.phpfreaks.com/topic/21227-php-syntax/ Share on other sites More sharing options...
redarrow Posted September 19, 2006 Share Posted September 19, 2006 That a function with a sql class thats it. Link to comment https://forums.phpfreaks.com/topic/21227-php-syntax/#findComment-94396 Share on other sites More sharing options...
hc Posted September 19, 2006 Author Share Posted September 19, 2006 yea, I know that, but what do the <<< and the ->mean?? Link to comment https://forums.phpfreaks.com/topic/21227-php-syntax/#findComment-94399 Share on other sites More sharing options...
redarrow Posted September 19, 2006 Share Posted September 19, 2006 http://uk.php.net/manual/en/language.oop5.basic.phpread ok. Link to comment https://forums.phpfreaks.com/topic/21227-php-syntax/#findComment-94400 Share on other sites More sharing options...
trq Posted September 19, 2006 Share Posted September 19, 2006 The -> is php equivelent of asp's . If youve worked with objects in asp then its exactly the same. Instead of...[code]if rs.eof then[/code]php would be...[code]if ($rs->eof) {[/code] Link to comment https://forums.phpfreaks.com/topic/21227-php-syntax/#findComment-94402 Share on other sites More sharing options...
hc Posted September 19, 2006 Author Share Posted September 19, 2006 thank you. Thats all I needed. I have been using ASP and .NET for years, and just got this thrown on me. I just needed a quick crash course. I appreciate the help. Thanks Link to comment https://forums.phpfreaks.com/topic/21227-php-syntax/#findComment-94403 Share on other sites More sharing options...
redarrow Posted September 19, 2006 Share Posted September 19, 2006 [code]<?phpfunction db(){ $query = " SELECT emp.id,emp.employer,sport.id AS job_type_id,sport.name AS jobtype FROM businesses.employers AS emp LEFT JOINmaster.sports AS sport ON sport.id = emp.sport_id WHERE emp.status_id = 1 ORDER BY emp.employer";$result=mysql_query($query);while($row = mysql_fetch($result) ) { $retval[] = $row; } } return $db; ?> [/code] Link to comment https://forums.phpfreaks.com/topic/21227-php-syntax/#findComment-94408 Share on other sites More sharing options...
hc Posted September 19, 2006 Author Share Posted September 19, 2006 thanks again, appreciated.. Link to comment https://forums.phpfreaks.com/topic/21227-php-syntax/#findComment-94422 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.