Re: HTML_Table question
| From: | Justin Patrin | Date: | Thu, 14 Oct 2004 17:44:37 +0000 |
| Subject: | Re: HTML_Table question | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-14913@lists.php.net to get a copy of this message | ||
On Wed, 13 Oct 2004 23:51:15 -0400, leegold <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?
>
> $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--