p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

  Return to Index  

beginning_php thread: Problem with while loop on pages 441, 442

Message #1 by "Ch'anyom" <chanyom@h...> on Wed, 14 Feb 2001 15:12:09 -0500
This is a multi-part message in MIME format.


Content-Type: text/plain;


Content-Transfer-Encoding: quoted-printable

I am trying my adaptation of the 'userviewr.php' example from chapter 12 

(pp 437-445).  Everything seems to be going fine until I get to the 

while loop at the bottom of page 441.  The following is my code:

  while($query_data =3D mysql_fetch_array($result)) {


    $sku =3D $query_data["sku"];

    $item_name =3D $query_data["item_name"];

    $size =3D $query_data["size"];

    $colour =3D $query_data["colour"];

    $price =3D $query_data["price"];

    $image_url =3D $query_data["image_url"];


    echo "<tr>\n";

    echo "<td rowspan=3D'2' width=3D'135'><!--image --><a 


"><img src=3D'images/$image_url' width=3D'125' height=3D'55' 

border=3D'2' alt=3D'$item_name'></a></td>\n";

    echo "<td class=3D'itemName'><!--item_name --><font 

color=3D'#000000'><b><font face=3D'Verdana, Arial, Helvetica, 

sans-serif' size=3D'-1'>$item_name</font></b></font></td>\n";

    echo "<td><!--colour --><font face=3D'Verdana, Arial, Helvetica, 

sans-serif' size=3D'-1' color=3D'#000000'>$colour</font></td>\n";

    echo "<td width=3D'105'> <font face=3D'Verdana, Arial, Helvetica, 

sans-serif' size=3D'-1'><a 


">View Details</a></font></td></tr>\n";

    echo "<tr>\n";

    echo "<td><!--price --><font face=3D'Verdana, Arial, Helvetica, 

sans-serif' size=3D'-1' color=3D'#003300'>\$$price</font></td>\n";

    echo "<td><!--size --><font size=3D'-1' face=3D'Verdana, Arial, 

Helvetica, sans-serif' color=3D'#000000'>$size</font></td>\n";

    echo "<td> </td>\n";

    echo "</tr>\n\n";


Nothing within the while loop gets echoed!   Anyone know what is going 


  Return to Index