I need help geting a tabing system working from mysql data.
Here is the table layout I want to call the data into ..
Code: Select all
<table width="59%" border="1" cellspacing="0" cellpadding="3">
<tr>
<td height="20" colspan="2"><font color="#000000"><b><font face="Arial" size="2">Forces Member</font></b></font></td>
<td width="45%" height="20"><font color="#000000" face="Arial" style="font-size: 9pt; font-weight: 700">Date Joined:</font></td>
</tr>
<tr>
<td width="14%" rowspan="4"> </td>
<td width="41%" height="20"><font color="#000000"><b><font face="Arial" style="font-size: 9pt">Alias:</font></b></font></td>
<td height="20"><font color="#000000" face="Arial" style="font-size: 9pt"><b>Rank: </b></font></td>
</tr>
<tr>
<td height="20" colspan="2"><font color="#000000"><span style="font weight: 700"><font color="#000000" face="Arial" style="font-size: 9pt"><b>Division:</b></font></span></font></td>
</tr>
<tr>
<td height="20"><font color="#000000" face="Arial" style="font-size: 9pt; font-weight: 700">Pref. Class:</font><font color="#000000" face="Arial" style="font-size: 8pt; font-weight: 700">
</font></td>
<td height="20"><font color="#000000" face="Arial" style="font-weight: 700; font-size: 9pt">Preferred Vehicle: </font></td>
</tr>
<tr>
<td height="20" colspan="2"><font color="#000000"><b><font face="Arial" style="font-size: 9pt">Specialty:
</font></b></font></td>
</tr>
</table>I have a basic tab system working now .. but it is just line by line .. no style to the table.
here is an example of that:
Code: Select all
$db = @mysql_connect("$hostserver","$username","$password")
or die ("Problems connecting to database server");
@mysql_select_db ("$dbname") or die ("Problem selecting database");
$query = "SELECT * FROM $dbtable";
$result = @mysql_query($query) or die ("Query failed");
$numofrows =@mysql_num_rows($result);
?>
<table width="666" border="0" align="center" cellpadding="5" cellspacing="1">
<tr bgcolor="#0066CC">
<td width="100" nowrap bgcolor="#0066CC"> <div align="center"><font size="2"><strong><font color="#FFFFFF">Part</font></strong></font></div></td>
<td width="538" nowrap bgcolor="#0066CC"> <div align="center"><font size="2"><strong><font color="#FFFFFF">Description</font></strong></font></div></td>
<td width="58" nowrap> <div align="center"><font size="2"><strong><font color="#FFFFFF">Price</font></strong></font></div></td>
<td width="36" nowrap> <div align="center"><font size="2"><strong><font color="#FFFFFF">Link</font></strong></font></div></td>
</tr>
<?php
for ($i = 0; $i < $numofrows; $i++) {
$row = mysql_fetch_assoc($result);
if ($i % 2) {
echo "<TR bgcolor="#CCCCCC">\n";
} else {
echo "<TR bgcolor="#0099CC">\n";
}
if(round($rowї'price']))
$price_field="\$".round($rowї'price']);
else $price_field="";
echo "<TD><strong>".$rowї'part']."</strong><TD>".$rowї'description']."</TD><TD align="right">".$price_field."</TD><TD>";
$image = $rowї'link'];
if ($image)
echo "<a href="$image" target="new"><strong><center>Link</center></strong></a>";
else
echo "<center></center>";
echo "</TD></TR>\n";
}
?>If that makes sence?
Thanks heaps
]{ronic