good day all, i apologise in advance if my code is poorly structured. i am having some issues with grouping some tables on a page there are headings such as
Bedside
table here
Bedside
table here
Hallway
table here
etc.
i need the two bedsides to group under one heading but display the information in each table. my code looks like the following. (again i apologise, i have been self teaching)
[php]
<?
$query = "Select Bookcase_ID from Books where Books.username = '$sessionuser' Group BY Bookcase_ID ";
$result = mysql_query ($query) or die(mysql_error());
?>
My Books
table, th, td {
border:1px solid black;
}
Welcome
<h1> Your books </h1>
<?php
while ($row = mysql_fetch_array($result)) {
$bookcasz = $row{'Bookcase_ID'};
$query = "select *
from Books
where Books.username = '". $_SESSION['username']. "'
AND Bookcase_ID = '$bookcasz'";
$result2 = mysql_query ($query);
while ($rows = mysql_fetch_array ($result2)){
?>
<tr>
<th align = "left"> ISBN </th>
<th align = "left"> Title </th>
<th align = "left"> Author </th>
<th align = "left"> Genre </th>
<th align = "left"> Price </th>
<th align = "left"> Bookcase </th>
<th align = "left"> Bk Shelf Number </th>
<th align = "left"> Description </th>
<th align = "left"> Username </th>
</tr>
<?
echo"<tr>"; /* not sure i need this line */
echo"<h2>" .$bookcasz. "</h2>";
echo" <td>". $rows [0] . " </td>";?>
<td> <?php echo $rows [1]; ?> </td>
<td> <?php echo $rows [2]; ?> </td>
<td> <?php echo $rows [3]; ?> </td>
<td> <?php echo $rows [4]; ?> </td>
<td> <?php echo $rows [5]; ?> </td>
<td> <?php echo $rows [6]; ?> </td>
<td> <?php echo $rows [7]; ?> </td>
<td> <?php echo $rows [8]; ?> </td>
<td align = "center"><a href = "DBdelete.php?txtisbn=<?php echo $rows [0]; ?>"> Delete </a> / <a href = "DBedit.php?txtisbn=<?php echo $rows [0]; ?>">Edit</a></td>
</tr></br>
<?}
}
?>
[/php]
can anyone tell me where i am going wrong aside from mixing html and php badly