I appreciate any help in advance. If you would please direct one browser here.[URL=http://]www.blvdcars.com/showcars.php[/URL]
What I want it to do is to select the kind of car (i.e. $kind) from my DB and display all of them in a few rows in 4 columns.
They all need to go in sequential order by an auto_incrementing $carid variable in my DB.
Here is my code:
<?
include('top.php');
include('left.php');
include('dbinfo.inc.php');
?> <td width="81%"> <table width="100%" border="0"> <?
$stock="SELECT * FROM auto ORDER BY kind LIMIT 100";
$result=mysql_query($stock);
$row = mysql_fetch_assoc($result);
$type = $row['kind'];
$query = mysql_query("SELECT * FROM auto WHERE kind='$type'") or die(mysql_error());
$stockid = $row['stockid'];
$year = $row['year'];
$make = $row['make'];
$model = $row['model'];
$color = $row['color'];
$image = $row['image'];
$stock="SELECT * FROM auto ORDER BY kind LIMIT 100";
$num=4;
$i=0;
while ($i < $num) {
$kind=mysql_result($result,$i,"kind");
?>
<tr>
<td><center><a href="show.php?<?= $stockid ?>">
<img src="cars/<?= $image ?>" alt="<?= $image ?>" height="100" width="250" border="1">
<br>
<? print('$year $make $model'); ?></a>
</center></td>
<a href="show.php?<?= $stockid ?>">
<img src="cars/<?= $image ?>" alt="<?= $image ?>" height="100" width="250" border="1">
<br>
<? print('$year $make $model'); ?></a>
</center></td>
<a href="show.php?<?= $stockid ?>">
<img src="cars/<?= $image ?>" alt="<?= $image ?>" height="100" width="250" border="1">
<br>
<? print('$year $make $model'); ?></a>
</center></td>
<a href="show.php?<?= $stockid ?>">
<img src="cars/<?= $image ?>" alt="<?= $image ?>" height="100" width="250" border="1">
<br>
<? print('$year $make $model'); ?></a>
</center></td></tr>
<?
++$i;
}
?>
</table>
</td>
<? include('bottom.php'); ?>
PLEASE HELP!!!