code:[php]
- <?php $sql = mysql_query(“SELECT * FROM categories”);
- <?php echo $category; ?>
while($row1 = mysql_fetch_array($sql)){
$category = $row1[“category”];
$sub =$row1[“subcategory”];
?>
<?php echo '<table border="1px" cellpadding="0px" cellspacing="0px" ><tr height=\'50px\'>'; //start the table, and the row.
// Query member data from the database and ready it for display
$sql = mysql_query(“SELECT * FROM products where category=’$category’”);
while($row2 = mysql_fetch_array($sql)){
$product = $row2[“product”];
$id =$row2[“id”];
$price =$row2[“price”];
if (in_array($x, $start)) { // if x equals a number in the start array
echo ‘
} ?>
<?php $sql = mysql_query("SELECT * FROM categories");
while($row3 = mysql_fetch_array($sql)){
$category = $row3[“category”];
$sub =$row3[“subcategory”];
?>
<div id="products">
<form action="" method="POST" name="myform<?php echo $id; ?>" class="myform<?php echo $id; ?>">
<input type="hidden" name="hiddenField" class="hiddenField" value="<?php echo $product; ?>" />
<input type="hidden" name="hiddenField2" class="hiddenField2" value="<?php echo $id; ?>" />
<input type="hidden" name="hiddenField1" class="hiddenField1" value="<?php echo $price; ?>" />
<input type="submit" name="submit" class="submit" value="<?php echo $product; ?>" style="background-color:lightgreen; height:50px; padding: 0px; margin:0px; width:100px;"> </form>
</div>
<?php
if (!in_array($x, $end)){ // if $x equals anything OTHER than 9, 18, etc - put in a line break
} else { // else if it DOES equal 9, 18 ,etc end the column
echo '}
?>
</div>
[/php]
so the problem I am having is getting the database results to display properly inside of tabbed pannels…currently only one tab and one button displays, there should be like 10 tabs and over 100 buttons. I am pretty sure it has to do with where my divs for the tabs are placed inside of my code. please only pay attention to this question, other stuff in there I will fix later, but this is the main thing right now. I will take any suggestions. thanks
here is an example of what I want:
Category1 category2 category3 category4 etc.
product1 product2 product3 product4 etc.
subcat1(if applicable) etc.
etc.
product2 could be under any category, just depending on what it would fall under.