kennmurrah
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>";
Can you post the script that creates db table structure ?
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.
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>";
#div-1 {
position:relative;
clear:both;
}
#div-1a {
float:left;
width:200px;
}
#div-1b {
float:left;
width:200px;
}
position:relative;
clear:both;
}
#div-1a {
float:left;
width:200px;
}
#div-1b {
float:left;
width:200px;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
kevp75, perfect
.... thank you so much.
.... thank you so much.
:) Anytime
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.