tags:

views:

71

answers:

1

Here is my while loop. Any suggestions?

    <?php
error_reporting(E_ALL);
ini_set("display_errors", "on");
include('header.php');
$search = "current_page_item";
include('nav.php');
include('sidebar.php');
?>
<div class="primary">
<br/>
<?php
    $userId = $_GET['id'];
    echo "<div class=\"item_list\">";
    $sql = "SELECT * FROM user WHERE id = " . intval($userId);
    $result = mysql_query($sql);
     while($item = mysql_fetch_array($result, MYSQL_ASSOC)){
echo "<b>Price: </b>" . $item['price'] .
     "</b><br/> <b>Category: </b>". $item['category'] . 
     "</b><br/> <b>Extra: </b>". $item['extra'] . 
     "</b><br/><b>Date Listed: </b>". $item['date'];
         }
    echo "</div>";
   ?>
  </div>
+5  A: 

you shouldn't echo html if possible, you could avoid using the <b> tag, and should use top-aligned labels.

however, I have no clue if any of those are what you wanted. Ask a more specific question and we can give you a more specific answer. :D

CrazyJugglerDrummer