Array Maybe

I am sad to say that I need help to understand what to do. I posted on the forum the other day and I am still working on the problem and I am sure that it is probably an easy fix but I am not sure what it is. First off I am supposed to use a while loop. I need to put the loop in and make it bring up 5 tables with different puppies on them. I don’t know if I need to put the puppy tables in an array or how to do it. I have a page with the 5 puppy tables on it and of course I can view page coding. Does anyone have any suggestion on how I should do this. Thank You.

Here is the original page where I am supposed to put in the while loop. This one has the table for a dog named Hoss. I need to use the while loop and display 4 more dogs like Hoss. Any help in helping me understand what to do would be greatly appreciated. Thank You very much.

[php]

<?php Find A Pet '; '; '; .auto-style1 {font-size: large;}'; .auto-style2 {font-size: large;text-align: right;}'; ; ; ; /* $i=0; $tops; $HOFF = 101; $tops = 24; $tops + HOFF; tops = $tops + "px"; echo $tops; exit; */ ; ; ;
;
;
;
; ; ; ;
Hoss ;   BassetHound
Male, 8 weeks  
Denver, Colorado, 72836 $1200.00
;
; ; ; ; ' ?>

[/php]

You have to do some major refactoring of that code, it is just a mess. You’re mixing php with html, escaping quotes in html, have lots of semicolons or quote-semicolon file endings (??) etc.

This is more what you want to have:

[php]<?php
/*
$i=0;
$tops;
$HOFF = 101;
$tops = 24;
$tops + HOFF;
tops = $tops + “px”;
echo $tops;
exit;
*/
?>

Find A Pet
  <style type="text/css">
     table.pet {width: 100%;}
     .PetPanel_LayerPic_01 {position: absolute; width: 120px; height: 83px; z-index: 1; left: 30px; top: 24px;}
     .PetPanel_layerText_01 {position: absolute; width: 472px; height: 83px; z-index: 2; left: 156px; top: 24px;}
     .auto-style1 {font-size: large; width: 244px;}
     .auto-style2 {font-size: large;text-align: right;}
  </style>
  <div class="pet">
     <img alt="" height="100" scr="PuppyPanelFullTrans.gif" width="640">
     <div class="PetPanel_LayerPic_01">
        <img alt="" height="79" src="../../petPicsthumbs/Hoss.jpg" width="96">
     </div>
     <div class="PetPanel_layerText_01">
        <table cellpadding="0" cellspacing="0" style="width: 100%; height: 78px">
           <tr>
              <td class="auto-style1">Hoss</td>
              <td class="auto-style1">&nbsp;</td>
              <td class="auto-style2">BassetHound</td>
           </tr>
           <tr>
              <td class="auto-style1" colspan="2">Male, 8 weeks</td>
              <td class="auto-style1">&nbsp;</td>
           </tr>
           <tr>
              <td class="auto-style1" colspan="2">Denver, Colorado, 72836</td>
              <td class="auto-style2">$1200.00</td>
           </tr>
        </table>
     </div>
  </div>
[/php]

I would not use tables at all as tables exist to display, well, tables. Doing layout in tables is considered bad practice.

You should be able to see which part of the code you need to repeat for each entry you have.

Sponsor our Newsletter | Privacy Policy | Terms of Service