Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The issue is your while loop. You're overwriting the value of $compare everytime it loops through. What you would want to do is something like </p> <pre><code> $compare = '&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;Compare Packages&lt;/title&gt; &lt;style type="text/css"&gt; ....//you styles here &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;table class="print_text" align="left"&gt; &lt;tr&gt; &lt;td width="200px" class="print_bold" align="right"&gt;Package&lt;/td&gt;&lt;td width="100px" class="print_bold" align="center"&gt;Package 1&lt;/td&gt;&lt;td width="100px" class="print_bold" align="center"&gt;Package 2&lt;/td&gt;&lt;td width="100px" class="print_bold" align="center"&gt;Package 3&lt;/td&gt;&lt;td width="100px" class="print_bold" align="center"&gt;Package 4&lt;/td&gt; &lt;/tr&gt;'; while($row=mysql_fetch_array($packages)){ $compare .= '&lt;tr&gt; &lt;td class="print_bold" align="right"&gt;Bank Code:&lt;/td&gt;&lt;td width="100px" align="center"&gt;'.$row['bank_name'].'&lt;/td&gt;&lt;td width="100px" align="center"&gt;display 2nd bank&lt;/td&gt;&lt;td width="100px" align="center"&gt;display 3rd bank&lt;/td&gt;&lt;td width="100px" align="center"&gt;display 4th bank&lt;/td&gt; &lt;/tr&gt;'; } //end while $compare .= '&lt;/table&gt; &lt;/body&gt; &lt;/html&gt;'; //rest of your code </code></pre> <p>This way it adds the results of the loop to the middle of the $compare string rather than overwriting it each time. Look up string concatenation for more details <a href="http://php.net/manual/en/language.operators.string.php" rel="nofollow">http://php.net/manual/en/language.operators.string.php</a> . Apologies if there are any minor code issues here as it's untested</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload