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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.