[thelist] laying out in PHP

Dave Stevens stem at stemofficial.co.uk
Wed Feb 27 15:02:01 CST 2002


this is the code I am using at the point I am having trouble with. $type is
passed to the browser when on the catalogue page you click either wheels or
misc.

if($type) { $result = mysql_query("SELECT * FROM products WHERE
type='$type'",$db);

                              if ($myrow = mysql_fetch_array($result)) {

                              printf("<table border=\"0\" width=\"300px\"
cellspacing=\"0\" cellpadding=\"0\">");

                              // display if there are records to display

                              do {

                              printf("<tr><td valign=\"top\"
align=\"center\">");

                              printf("<a href=\"%s?id=%s\"><img
src=\"wheels/%s\" alt=\"%s\" border=0 width=\"104\" height=\"99\"></a>\n",
$PHP_SELF, $myrow["id"], $myrow["pic"], $myrow["name"]);

                              printf("</td></tr><tr><td
valign=\"top\">%s</td></tr>", $myrow["name"]);

                            } while ($myrow = mysql_fetch_array($result));

                              printf("</table>");

                          }

thanks for any help!
Dave Stevens






More information about the thelist mailing list