Link to home
Start Free TrialLog in
Avatar of kennmurrah
kennmurrahFlag for United States of America

asked on

two columns (via DIV statements) not displaying as expected

I thought I had the solution but not quite ... the code below results in "the second column" being displayed in the first column, not in the second ... and "paper 2" and "paper 3" should be in the left most column ... what have done wrong?



 
//paper
$result3 = mysql_query("select * from items
where product_number = '$category' and joblet_number = 2 order by item_name
");
if ($row = mysql_fetch_array($result3)) { 
echo "<div id=\"div-1\">";
echo "<div id=\"div-1a\">";
echo "PAPER:";
echo "<select name=\"folding\" onchange=\"determineDiv(this);\">
<option>CHOOSE</option>";
do { 
$item_name = $row["item_name"];
	$item_number = $row["item_number"];
echo "<option value = \"$item_number\">$item_name</option>";
	
}
while($row = mysql_fetch_array($result3));
echo "<option>CUSTOM</option>";
echo "</select></p>";
echo "</div>";
echo "<div id=\"div-1b\">";
echo "<p>copy for second column</p>";
echo "</div>";
echo "</div>";


}
//paper
$result3 = mysql_query("select * from items
where product_number = '$category' and joblet_number = 2 order by item_name
");
if ($row = mysql_fetch_array($result3)) { 
echo "PAPER 2:<br>";
echo "<select name=\"folding\">
<option>CHOOSE</option>";
do { 
$item_name = $row["item_name"];
	$item_number = $row["item_number"];
echo "<option value = \"$item_number\">$item_name</option>";
	
}
while($row = mysql_fetch_array($result3));
echo "<option>CUSTOM</option>";
echo "</select><p>";
}
//paper
$result3 = mysql_query("select * from items
where product_number = '$category' and joblet_number = 2 order by item_name
");
if ($row = mysql_fetch_array($result3)) { 
echo "PAPER 3:<br>";
echo "<select name=\"folding\">
<option>CHOOSE</option>";
do { 
$item_name = $row["item_name"];
	$item_number = $row["item_number"];
echo "<option value = \"$item_number\">$item_name</option>";
	
}
while($row = mysql_fetch_array($result3));
echo "<option>CUSTOM</option>";
echo "</select><p>";
}
echo "<hr>";

Open in new window

Avatar of Lukasz Chmielewski
Lukasz Chmielewski
Flag of Poland image

Can you post the script that creates db table structure ?
Avatar of kennmurrah

ASKER

Let me do a better job of isolating the problem.  The code below eliminates unnecessary code ... if I can get this to work, I can get the rest to work ... this ought to be much easier to troubleshoot, though I've looked at it a hundred times and I can't catch the mistake :-(

This code results in "copy for second column" being displayed beneath the "Paper 1" copy instead of to the right of it as I intended.

thanks.

CSS:
#div-1 {
 position:relative;
}
#div-1a {
 position:absolute;
 top:0;
 right:200;
 width:200px;
}
#div-1b {
 position:absolute;
 top:0;
 left:0;
 width:200px;
}

HTML:
/paper
$result3 = mysql_query("select * from items
where product_number = '$category' and joblet_number = 2 order by item_name
");
if ($row = mysql_fetch_array($result3)) { 
echo "<div id=\"div-1\">";
echo "<div id=\"div-1a\">";
echo "PAPER:";
echo "<select name=\"folding\" onchange=\"determineDiv(this);\">
<option>CHOOSE</option>";
do { 
$item_name = $row["item_name"];
	$item_number = $row["item_number"];
echo "<option value = \"$item_number\">$item_name</option>";
	
}
while($row = mysql_fetch_array($result3));
echo "<option>CUSTOM</option>";
echo "</select></p>";
echo "</div>";
echo "<div id=\"div-1b\">";
echo "<p>copy for second column</p>";
echo "</div>";
echo "</div>";

Open in new window

#div-1 {
 position:relative;
 clear:both;
}
#div-1a {
 float:left;
 width:200px;
}
#div-1b {
 float:left;
 width:200px;
}
ASKER CERTIFIED SOLUTION
Avatar of kevp75
kevp75
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
kevp75, perfect

 .... thank you so much.  
:)   Anytime
Avatar of Guy Hengel [angelIII / a3]
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.