I have the following code and the while loop is working but it is looping through each picture on a new line. I would like to put all the pictures on the same line side by side and not sure if this is a css side or my php side. I tried to include inline-block in my css code but can’t get it to work with my div class of image:
while($row2 = mysqli_fetch_assoc($result2)) {
$sql3 = "SELECT * FROM pictures WHERE name = ?;";
$stmt = mysqli_stmt_init($conn);
if(!mysqli_stmt_prepare($stmt, $sql3)) {
echo "SQL error";
} else {
mysqli_stmt_bind_param($stmt, "s", $row2['clinic_name']);
mysqli_stmt_execute($stmt);
$result3 = mysqli_stmt_get_result($stmt);
$rowNumber++;
echo '<tr><th>Clinic NO:</th><td>'.$rowNumber.'</td></tr>
<tr><th>Clinic Name:</th><td>'.$row2['clinic_name'].'</td></tr>
<tr><th>Clinic Address:</th><td>'.$row2['clinic_address'].'</td></tr>
<tr><th>Clinic Number:</th><td>'.$row2['clinic_number'].'</td></tr>
<tr><th>Which of the following are you?</th><td>'.$row2['type_of_profession'].'</td></tr>
<tr><th>Services:</th><td>'.$row2['services'].'</td></tr>
<tr><th>Recommended Doctors:</th><td>'.$row2['doctors'].'</td></tr>';
while($row3 = mysqli_fetch_assoc($result3)) {
echo '<tr><th>Pictures:</th><td><img src='.$row3['pictures'].' class="image"></td></tr>';
}
}
A simple method that might work considering that its html formatting where the problem is … the tr and td tags. Use something like front page to make a table as you like it with sample images to give you the proper code for a table and html tags, look at code source … and then place your php directives where your sample image code is to display the images you want in the proper place…the problem is in your table code structure … where to put the tr and td tags …
At a glance your css is showing a larger table with two smaller columns inside and one with rows … to have the glass closer put it in the same table as the stethoscope …then you can adjust space… in a different table, all you can do is float it left as far as it will go to the border of the table. In the same table one image can be float left and the other center and both be closer together… option two is do float right on the stethoscope and left on the glass… then they are both on the right border and closer together.