Hi,
The code bellow is what i have so far. This pulls up the content fine from the database, all i want to do now, is to place the image with the link bellow, in a table. I want to table to have 6 columns and as many rows needed.
ie, i want to fill up the table with the content from the database in the order:
column 1 - row 1,
column 2 - row 1,
column 3 - row 1,
column 4 - row 1,
column 5 - row 1,
column 6 - row 1, // 6 columns filled up, so go to next row...
column 1 - row 2,
column 2 - row 2,
column 3 - row 2,
ect...............
does that make more sence??
This is the code i have so far, it just displays the data in rows..
PHP Code:
<?php
$tariff = $_GET['tariff'];
$make = $_GET['make'];
if($_GET['make'] == "") $make = ("xxxx");
$username="xxxxx";
$password="xxxxx";
$database="xxxxx";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM xxxxx WHERE make='$make'";
$result=mysql_query($query);
$num=mysql_numrows($result);
$handset=mysql_result($result,$i,"handset");
$make=mysql_result($result,$i,"make");
$id=mysql_result($result,$i,"id");
$handsetclean = strtolower($handset);
$makeclean = strtolower($make);
$makeclean2 = str_replace(" ", "-", $makeclean);
$url = str_replace(" ", "-", $handsetclean);
$i=0;
while ($i < $num) {
$handset=mysql_result($result,$i,"handset");
$make=mysql_result($result,$i,"make");
$id=mysql_result($result,$i,"id");
?>
<span style="FONT-WEIGHT: 700; COLOR: #6491d2; TEXT-DECORATION: none">
<table cellSpacing="5" cellPadding="10" width="100%" border="0" id="table3">
<tr vAlign="center" align="middle">
<td bgColor="#ffffff" style="font-family: tahoma; font-size: 11px; text-decoration: none; color: #6491d2" bordercolor="#FFFFFF">
<font face="Tahoma" color="#2d75d7" size="2">
<a href="http://www.mysite.com/<?php echo ("$makeclean-mobile-phones/$url.php")?>"><font color="#2D75D7">
<span style="text-decoration: none; font-weight: 700">
<?php echo ("$handset")?></span></font></a></font><font face="Tahoma" size="1"><p>
<td width="65" bgColor="#ffffff" style="font-family: tahoma; font-size: 11px; text-decoration: none; color: #6491d2">
<p align="center"><font color="#2d75d7">
<img src="http://www.affiliatesite.com/images/075/med<?php echo ("$id")?>.jpg" border="0"></font></td>
</tr>
<?
$i++;
}
?>
Bookmarks