Ok so I need to know how this code:
[code]
<?php
// Query member data from the database and ready it for display
$sql1 = mysql_query("SELECT * FROM products where id='".$pid."'");
while($row = mysql_fetch_array($sql1)){
$product =$row["product"];
$pid=$row["id"];
?>
<?php
// Query member data from the database and ready it for display
$sql4 = mysql_query("SELECT * FROM labels where item_id='".$pid."'");
while($row = mysql_fetch_array($sql4))for($i=0; $i<1; $i++){
$label =$row["label"];
$lid=$row['id'];
echo $label;
?>
<?php
// Query member data from the database and ready it for display
$sql3 = mysql_query("SELECT * FROM options where item_id='".$pid."' && label_id='".$lid."'");
while($row = mysql_fetch_array($sql3)){
$option =$row["option"];
?>
<?php echo $option; ?>
<?php
}
?>
<?php }
?>
<?php
}?>
If this product is for someone other than the listed, change it, otherwise leave it:
[/code]
specifically this part:
[code]<?php
// Query member data from the database and ready it for display
$sql4 = mysql_query("SELECT * FROM labels where item_id='".$pid."'");
while($row = mysql_fetch_array($sql4))for($i=0; $i<1; $i++){
$label =$row[“label”];
$lid=$row[‘id’];
echo $label;
?>
<?php
// Query member data from the database and ready it for display
$sql3 = mysql_query("SELECT * FROM options where item_id='".$pid."' && label_id='".$lid."'");
while($row = mysql_fetch_array($sql3)){
$option =$row["option"];
?>
<?php echo $option; ?>
<?php
}
?>
[/code]
I need to create an array from the name(1,2)[] parts. The thing is, they are going to be pulled in a loop and return all results. so there could be multiple name1[]'s name2[]'s or name[]'s. I need to know how I would combine each one in it’s loop to make part of a string. thing is, the first time name[] would be included, second time it wouldn’t be included. then the arrays combine to make one. so the final array looks like this
name[] name1[] name2[] name1[] name2[] name1[] name2[]. etc. anyhelp on this?