jamyboy Posted December 16, 2011 Report Share Posted December 16, 2011 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 Quote Link to comment Share on other sites More sharing options...
Flightguy123 Posted December 16, 2011 Report Share Posted December 16, 2011 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 Quote Link to comment Share on other sites More sharing options...
jamyboy Posted December 16, 2011 Author Report Share Posted December 16, 2011 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 } ?> Quote Link to comment Share on other sites More sharing options...
jamyboy Posted December 16, 2011 Author Report Share Posted December 16, 2011 oh thank you very much flightguy i sorted out its working fine (SOLVED) Quote Link to comment Share on other sites More sharing options...
Flightguy123 Posted December 16, 2011 Report Share Posted December 16, 2011 Yup, np! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.