Jump to content

Recommended Posts

Posted

Dear Members i need help in diplaying my new pilot information on front page of my website such as

<th scope="col" class="rounded-company">Pilot Name</th>
           <th scope="col" class="rounded-q1">Airline</th>
           <th scope="col" class="rounded-q2">Location</th>
           <th scope="col" class="rounded-q3">Hub</th>
           <th scope="col" class="rounded-q3">Current Rank</th>
           <th scope="col" class="rounded-q4">Date joined</th>

so please guide me what php code should i put in <td>***HERE***</td> to fetch the data from database

i dont know why this is not working

<?php echo $userinfo->firstname . ' ' . $userinfo->lastname; ?>

Regards

James

Posted

Hi,

I think you should do a foreach like this

foreach($pilots as $pilot)
{

Then use a code like this

<?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid). ' ' .$pilot->firstname . ' ' . $pilot->lastname?>

This is some code that i pulled from the default template, just guessing on it ha :rolleyes:

Posted

i have checked it but getting Error this is how i placed the code if i am doing it wrong way please paste the full code for me as help

 <?php
 foreach($pilot as $pilot)
{
?>
   <tbody>
   	<tr>
       	<td><?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid). ' ' .$pilot->firstname . ' ' . $pilot->lastname?></td>
           <td><?php echo $userinfo->airlines;?></td>
           <td><img src="<?php echo Countries::getCountryImage($userinfo->location);?>" 
							alt="<?php echo Countries::getCountryName($userinfo->location);?>" /> <?php echo Countries::getCountryName($userinfo->location);?></td>
           <td><?php echo $userinfo->hub;?></td>
           <td><?php echo $userinfo->rank;?></td>
           <td><?php echo date(DATE_FORMAT, strtotime($userinfo->joindate));?></td>
<?php
}
?>

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.

Loading...
×
×
  • Create New...