Hello PHP geniuses! I am a beginner in php and would like to seek your expert advices and knowledge. When I display the result to a table, it always loop at the bottom, I want to display the another table at the right side of the first table. When I try to use the float:left, its coming out of the DIV and the white background is disappearing. This is my code:
<?php
$nationality = $_POST['nationality'];
$category = $_POST['category'];
if ($category == 'All' and $nationality == 'All')
{
$sql="Select * from $tbl_name where Published = 'Y'";
}
elseif ($nationality and $category == 'All')
{
$sql = "Select * from $tbl_name where Published = 'Y' and Nationality = '$nationality'";
}
elseif ($category and $nationality = 'All')
{
$sql="Select * from $tbl_name where Published = 'Y' and Category = '$category'";
}
$result=mysql_query($sql);
while($rows=mysql_fetch_array($result)){
{
@$image=$rows['Photo'];
?>
<?php
}
?>
<table bgcolor="#FFFFFF" style="font-size:13px; float:left; margin-bottom:10px; margin-top:20px" align="center" width="400" height="40%"border="1">
<tr>
<td width="150" rowspan="10"><center><a href="image/<?php echo $image;?>"><img src="image/<?php echo $image; ?>" width="150" height="100" border="0"></a></center></td>
<td width="128">Category:</td>
<td width="150"><p><?php echo $rows['Category']; ?></p></td>
</tr>
<tr>
<td>Staff Code:</td>
<td><p><?php echo $rows['id']; ?></p></td>
</tr>
<tr>
<td>Name:</td>
<td><?php echo $rows['Firstname']; ?></td>
</tr>
<tr>
<td>Nationality</td>
<td><?php echo $rows['Nationality']; ?></td>
</tr>
<tr>
<td>Weight</td>
<td><?php echo $rows['Weight']; ?></td>
</tr>
<tr>
<td>Height</td>
<td><?php echo $rows['Height']; ?></td>
</tr>
<tr>
<td>Age</td>
<td><?php echo $rows['Age']; ?></td>
</tr>
<tr>
<td>Job Title</td>
<td><?php echo $rows['Jobtitle']; ?></td>
</tr>
<tr>
<td>Qualifications</td>
<td><?php echo $rows['Qualifications']; ?></td>
</tr>
<tr>
<td colspan="2"><center>
<form action="requestform.php" name="request" method="post">
<input type='submit' name="submit" class="button" value='Request' />
</form>
</center></td>
</tr>
</table>
<?php
}
?>
This is the CSS
#content{
background-color:#FFF;
width: 955px;
min-height: 100%;
margin-left:auto;
margin-right:auto;
padding: 10px;
}