This link: http://www.blvdcars.com/showcars.php?kind=Car

Shows the right amount of columns, but the same variable 3 times. I need 3 variables to print out in columns of 3 in an infinate amount of rows. Here is my code if you can help 🙂 :

<?
include('top.php');
include('left.php');
include('dbinfo.inc.php');
echo" <td width='81%'><table><tr>";

$kind = $HTTP_GET_VARS['kind'];
$query = mysql_query("SELECT * FROM auto WHERE kind='$kind'") or die(mysql_error());
$num=mysql_num_rows($query) or die(mysql_error());

for($i=0; $i<$num; $i++)
{ 
$row = mysql_fetch_array($query) or die(mysql_error());
$cols = 0;
while($cols!=3){
$link = $row['stockid'];
$year = $row['year'];
$make = $row['make'];
$model = $row['model'];
echo "<td><a href='show.php?stockid=$link'><img src='$kind/$image' width='250'
height='100' /><br> $year $make $model </a><td>";
$cols++; 
}
echo "</tr><tr>";
}
echo "</tr></table></td>";

include('bottom.php'); 

?>

Thanks again to all whom have helped me along my ways of wisdom.

    <?
    include('top.php');
    include('left.php');
    include('dbinfo.inc.php');
    echo" <td width='81%'><table><tr>";
    
    $kind = $HTTP_GET_VARS['kind'];
    $query = mysql_query("SELECT * FROM auto WHERE kind='$kind'") or die(mysql_error());
    $num=mysql_num_rows($query) or die(mysql_error());
    
    for($i=0; $i<$num; $i++) { 
    
      $cols = 0;
      while($cols!=3) {
        $row = mysql_fetch_array($query) or die(mysql_error());
    
    $link = $row['stockid'];
    $year = $row['year'];
    $make = $row['make'];
    $model = $row['model'];
    
    echo "<td><a href='show.php?stockid=$link'><img src='$kind/$image' width='250'
    height='100' /><br> $year $make $model </a><td>";
        $cols++; 
      }
      echo "</tr><tr>";
    }
    echo "</tr></table></td>";
    
    include('bottom.php'); 
    
    ?>
    
    

    tadáááá

      Write a Reply...