User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 426,522 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,905 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 153 | Replies: 1 | Solved
Reply
Join Date: Jul 2008
Posts: 2
Reputation: shekki is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
shekki shekki is offline Offline
Newbie Poster

Help displaying results

  #1  
Jul 25th, 2008
Hi, I'm having trouble getting this to run. basically I'm trying to get a table to display miles per gallon into liters per 100 kilometers in increments of 10. Every time i run it though, it just displays the table header without any results. Any advice would really be appreciated

  1. <?php
  2. //create table
  3. echo "<table width='50%' align='center' border='1'>";
  4. echo "<tr>
  5. <th>MPG</th>
  6. <th>KMPL</th>
  7. </tr>";
  8.  
  9. for ($mpg = 10; $mpg >50; $mpg+=5)
  10. {
  11. printf("<tr><td>%d </td><td>%f <td></tr><br />", $mpg, $mpg*42.5143707);
  12. }
  13. echo"</table>";
  14.  
  15. ?>
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2008
Posts: 2
Reputation: shekki is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
shekki shekki is offline Offline
Newbie Poster

Re: Help displaying results

  #2  
Jul 25th, 2008
the inequalities were backwards just in case anyone was wondering
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 6:26 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC