extra information for first result

Status
Not open for further replies.

Busarus

New Member
Not a programmer so bear with me.....

I have a results page which pulls out relevant jobs....

However I want extra information shown for the first result produced.

I have managed to get the pages to publish the extra information but for all the results produced using

Code:
<?php

foreach ($obj->results as $result) 
{
echo template_simple ('{company_blurb} <img src="/templates/{user_id}/logo.jpg" border="0" alt="company_name" border=0  align=right >', $result);
}

?>
How do I get it to just pull this values from the first line of the results array
 

CiaranR

Weeno Ltd + Skimlinks.com
Try this

PHP:
<?php

$i = 1;
foreach ($obj->results as $result) {

// show regular result
echo template_simple ('{company_blurb} <img src="/templates/{user_id}/logo.jpg" border="0" alt="company_name" border=0  align=right >}', $result);

if ($i == 1){ 

// Add your extra info for the first line here

}

$i++;

}

?>
 

Briask

New Member
the first result is also held in
Code:
[COLOR=#0000bb]$obj[/COLOR][COLOR=#007700]->[/COLOR][COLOR=#0000bb]results[0][/COLOR]
 
Status
Not open for further replies.
Top