Re: Re: [PEAR] HTML_Table question
| From: | Justin Patrin | Date: | Thu, 14 Oct 2004 23:30:02 +0000 |
| Subject: | Re: Re: [PEAR] HTML_Table question | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-14918@lists.php.net to get a copy of this message | ||
On Thu, 14 Oct 2004 19:45:53 +0000, leegold2@verizon.net
<leegold2@verizon.net> wrote:
>
>
> > > Below I first have standard PHP combining/rendering two tables and
> > > possibly multiple records, below that I have HTML_table code that I want
> > > to have render the same data but the problem is that [in the "standard"
> > > php] I've embedded a query/loop inside another query loop in order to
> > > get the data I want. How do I do it with the HTML_Table object?
> > > I'd expect within the page_url table cell I'd have the multiple urls
> > > from the inner query. Hope you understand what I'm asking. Thanks, Lee G.
> >
> > .....so why don't you do it?
>
> Is it that easy? I'm sorry i'm not seeing it. Could you give me a snipet or an
> example? Thanks!
>
>
> >
> > >
> > > $query = "SELECT page.* FROM
page LEFT JOIN
> > > keywords USING
> > > (page_id) WHERE MATCH
> > > (keywords.keyword_txt) AGAINST
> > > ('$radio_keyword' IN BOOLEAN MODE)";
> > >
> > > $result = mysql_query($query);
> > >
> > > for( $i = 1; $row = mysql_fetch_array($result); $i++ )
> > > {
> > > echo "$i. Title: <b>
> > > ".$row['title']."</b><br>";
> > > $query1 = "SELECT url_pages.page_url FROM url_pages WHERE
> > > page_id=$row[page_id]";
> > > $result1 = mysql_query($query1);
> > > for( $j = 1; $row1 = mysql_fetch_array($result1); $j++ ) {
> > > echo "URL: ".$row1['page_url']."<br>";
> >
> > $row['page_url'] .= $row1['page_url'].'<br/>';
> >
> > > }
> > > echo "Description: ".$row['descrip']."<p>";
> > >
> > > $table ->
> > > addRow(array($row["title"], $row["page_url"],
> > > $row["descrip"]));
> > >
> > > }
> > > ...
> > > echo $table->toHTML();
> > > ....
> > >
> >
> > --
> > paperCrane --Justin Patrin--
> >
>
>
The snippet (one line) was in-line with the rest of your code. Put
this in the inner loop.
$row['page_url'] .= $row1['page_url'].'<br/>';
--
paperCrane --Justin Patrin--