there is problem in my while loop

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • robin1983
    New Member
    • Oct 2007
    • 99

    there is problem in my while loop

    I have a problem while loop of the following program. The problem is that, it showing the output that i wished to show, but the other remaining HTML portion afer the while loop is not showing in my pages. I m giving the code below
    [HTML]<body>
    <div id="maincontain er">

    <div id="topsection" ><span style="font-size:30px; font-weight:bold; color:#6666FF"> Welcome to Habsons Telephone Directory</span><span style="float:le ft">Hi
    <?php
    echo "<font size=\"4\" color=\"red\">" ;
    echo ucwords($_SESSI ON['username']);
    echo "</font>";
    ?>
    &nbsp<a href="logout.ph p" style="text-decoration:none ; font-weight:bold"> [ Logout ]</a>
    </span>
    <?php include("topMen u.php"); ?></div>

    <div id="contentwrap per">
    <div id="contentcolu mn">
    <div style="margin-top:20px; margin-bottom:20px; margin-left:7.5em; width:650px; ">
    <fieldset style="width:65 0px;">
    <legend>Detaile d </legend>
    <?php

    include "config.inc.php ";
    include "connect.inc.ph p";
    $error = "";
    $vTelNumber = $_POST['vTelNumber'];
    // echo $vTelNumber;
    ?>
    <table width="100%" cellspacing="1" align="center">
    <tr>
    <td colspan="5" align="left">
    Phone Number:
    <?php echo $vTelNumber; ?>
    </td>
    </tr>
    <tr>
    <td class="td1">Sl No</td><td class="td1">BIl l Received On</td><td class="td1" align="center" valign="bottom" >Bill Amount</td><td class="td1">Bil l Last Date</td><td class="td1">Det ail</td></tr>
    <?php
    $sql = "SELECT * FROM billrectable WHERE vTelNumber = '$vTelNumber'";
    $result = mysql_query($sq l) or die(mysql_error ());
    if($result>0)
    {
    $i = 1;


    while($row = mysql_fetch_arr ay($result) or die(mysql_error ()))
    {
    if($i%2==0)
    {
    $bg = "#C0C0C0";
    }
    else
    {
    $bg = "#969696";
    }
    ?>
    <?php

    $iBillID = $row['iBillID'];
    $iBillNumber = $row['iBillNumber'];
    echo "<tr bgcolor=\"$bg\" >";
    echo "<td class=\"td1\">$ i</td>";
    echo "<td class=\"td1\">" .$row['dBillRecDate']."</td>";
    echo "<td class=\"td1\">" .$row['fAmountToPay']."</td>";
    echo "<td class=\"td1\">" .$row['dBillDateOfPay ']."</td>";
    echo "<td class=\"td1\">< a href=\"detailed _bill_by_number .php?iBillID=$i BillID&iBillNum ber=$iBillNumbe r&foloer=39fmia s90ufja9fj&sick =fjijkackj109iu 903j\">Detail</a></td>";
    $i++;
    }
    // exit;
    }

    ?>
    </table>
    <table>
    <tr><td>djfkd f</td></tr>
    </table>

    </fieldset>
    </div>
    </div>
    </div>

    <div id="leftcolumn" >
    <div class="innertub e"><?php include("leftMe nu.php"); ?> </div>

    </div>



    <div id="footer">Al l rights reserved &copy </div>

    </div>
    </body>

    [/HTML]
    when i run the program the <div id ="left"><?ph p include("leftMe nu.php"); ?> </div> and footer div is also not shown. i dont know what is the problem. please help me to find the solution ............tha nks .
  • code green
    Recognized Expert Top Contributor
    • Mar 2007
    • 1726

    #2
    Check the number of closing tags matches the opening,
    particularly for the table elements.
    Is the exit commented out in your test script?
    Don't forget the closing HTML

    Comment

    • recordlovelife
      New Member
      • Sep 2007
      • 31

      #3
      yeh, looks like you left out a </tr> tag.

      Comment

      • robin1983
        New Member
        • Oct 2007
        • 99

        #4
        Thanks, now it working fine
        Originally posted by recordlovelife
        yeh, looks like you left out a </tr> tag.

        Comment

        Working...