Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7806221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T02:27:55+00:00 2026-06-02T02:27:55+00:00

I have the following php code: echo <div style=’float:left;’>; echo <table>; echo <tr>; echo

  • 0

I have the following php code:

echo "<div style='float:left;'>";
echo "<table>";
echo "<tr>";
echo "<th></th>";
echo "<th colspan='4'>Laks beholdt</th>";
echo "</tr>";
echo "<tr>";
echo "<th>Uke</th>";
echo "<th>&lt;3 kg</th>";
echo "<th>3-7 kg</th>";
echo "<th>&gt;7 kg</th>";
echo "<th>Totalt</th>";
echo "</tr>";

while ($row = mysql_fetch_array($result, MYSQL_ASSOC) or die(mysql_error()))
{
   echo "<tr>";
   echo "<td>" . $row['Uke'] . "</td>";
   echo "<td style='text-align:right; padding-right:10px;'>" . number_format($row['SumSmall'], 1,
      ",", " ") . " kg</td>";
   echo "<td style='text-align:right; padding-right:10px;'>" . number_format($row['SumMedium'], 1,
      ",", " ") . " kg</td>";
   echo "<td style='text-align:right; padding-right:10px;'>" . number_format($row['SumLarge'], 1,
      ",", " ") . " kg</td>";
   echo "<td style='text-align:right; padding-right:10px;'>" . number_format($row['SumVekt'], 1, ",",
      " ") . " kg</td>";
   echo "</tr>";
}

echo "</table>";
echo "</div>";

I get the expected output from the while loop, but the end tags for my table and div -or any other output for that matter- does not show. I get no error message, and I fail to see any errors in my html. I’ve tried referencing the array by numbers instead of associative, but I get the same result.

I’ve written a hundred similar loops without error, but I’m out of ideas here :/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T02:27:57+00:00Added an answer on June 2, 2026 at 2:27 am

    The or die() statement is causing it to stop execution. When $row = mysql_fetch_array($result, MYSQL_ASSOC) should be stopping the loop, it hits the die() instead. Since there was no error, nothing is printed from mysql_error()

    echo "Before loop\n";
    
    $x = 1;
    while($foo = bar($x) or die('Died')) {
        echo $x++, "\n";
    }
    
    echo "After loop\n";
    
    function bar($x) {
        if($x < 5) {
            return $x;
        }
        return false;
    }
    
    //outputs:
    //Before loop
    //1
    //2
    //3
    //4
    //Died
    

    Codepad version

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a PHP code to echo the following div <div id=main_catsel> <select
I have the following code: <div><strong>Name: </strong><?php echo anchor('http://'.$link, $row->Name); ?></div> Which takes a
I have to image with the following code: echo '<div class=thumb style=width: '.$array['thumb_width'].'px; height:
I have the following PHP code: <?php if(isset($_GET['article'])) { echo <b>success</b>; } ?> And
I have the following code: <?php $student_no = $_GET['student_no']; echo '<form name=student action=PROCESS_FEE007.php method=POST>';
i have the following code : <input type=text value=<?php echo $_GET['msg']; ?>> This input
I have the following piece of code. <?php $agentId = LTH001; echo && .
I have the following js files in my code for EditInPlace... <?php echo $javascript->link('jquery.js');?>
I have following PHP code $val=<div id=user.$row['cid']. userid=.$row['cid']. class=innertxt><img src=images/images.jpg width=50 height=50><strong>.$uname.</strong><ul> <li>Email: .$row['cemail'].</li>
I have the following PHP code doing a very simple select into a table.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.