ti_nhatrang
08-06-2007, 01:53 AM
hi guys,
I ran a few sql queries for a top portion of my page... however, I want to use the same fecth of arrays again at the bottom of the page:
Here's what I got:
<div class="interval">
<img src="images/red.gif" alt="*" width="407" height="53" />
<p id="breadcrumb">Entertainment » <? echo "$title » $ettitle"; ?> <br />
<form name="etselect">
<select name="et_select" onchange="self.location.href=this.value"><option value="#">See More</option>
<? $et_sel_db = mysql_query("select title,firstpostid from localhost_vbnews.thread where forumid=$ch AND open=1 AND title !='$ettitle2' ORDER BY dateline DESC LIMIT 30") or die(mysql_error());
while($et_sel = mysql_fetch_array($et_sel_db)) {
$et_sel_att_db = mysql_query("select attachmentid from localhost_vbnews.attachment where postid=$et_sel[firstpostid] limit 1") or die(mysql_error());
while($et_sel_att = mysql_fetch_array($et_sel_att_db)) {
echo "<option value=\"page.php?et=$et_sel[firstpostid]&ch=$ch&desc=$et_sel_att[attachmentid]\">$et_sel[title]</option>;" }}?></select></p>
</div>
That's what I have, and I want to use the same outputs from the sql statement for the follwing html code:
<li><img src="/<? echo "$et_sel_att[attachmentid]"; ?>.pic" width="58" height="38" alt="red" /><a href="#"><? echo "$et_sel[title];" ?></a> <? echo "$et_se[description]"; ?></li>
That is what i want to use with the queries above... the above spit out 30 into a option select form, I want it to also spit out 30 at the bottom in a LI form...
please help, and thank you in advance.
I ran a few sql queries for a top portion of my page... however, I want to use the same fecth of arrays again at the bottom of the page:
Here's what I got:
<div class="interval">
<img src="images/red.gif" alt="*" width="407" height="53" />
<p id="breadcrumb">Entertainment » <? echo "$title » $ettitle"; ?> <br />
<form name="etselect">
<select name="et_select" onchange="self.location.href=this.value"><option value="#">See More</option>
<? $et_sel_db = mysql_query("select title,firstpostid from localhost_vbnews.thread where forumid=$ch AND open=1 AND title !='$ettitle2' ORDER BY dateline DESC LIMIT 30") or die(mysql_error());
while($et_sel = mysql_fetch_array($et_sel_db)) {
$et_sel_att_db = mysql_query("select attachmentid from localhost_vbnews.attachment where postid=$et_sel[firstpostid] limit 1") or die(mysql_error());
while($et_sel_att = mysql_fetch_array($et_sel_att_db)) {
echo "<option value=\"page.php?et=$et_sel[firstpostid]&ch=$ch&desc=$et_sel_att[attachmentid]\">$et_sel[title]</option>;" }}?></select></p>
</div>
That's what I have, and I want to use the same outputs from the sql statement for the follwing html code:
<li><img src="/<? echo "$et_sel_att[attachmentid]"; ?>.pic" width="58" height="38" alt="red" /><a href="#"><? echo "$et_sel[title];" ?></a> <? echo "$et_se[description]"; ?></li>
That is what i want to use with the queries above... the above spit out 30 into a option select form, I want it to also spit out 30 at the bottom in a LI form...
please help, and thank you in advance.
