Jump to content

PHP syntax


hc

Recommended Posts

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.employer
SQL;
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

[code]

<?php

function db(){  
   
$query = " 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.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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.