In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Jaxon) wrote:

> the following function is supposed to build an html table, creating a
> content row for every row in a database table.  It is creating a table with
> the correct number of rows, but NO content is being echoed...
<snip>
>         $sql="select i.nID, i.date, i.headline, i.subtitle, i.blurb from
>         news_items i, news_box b where i.nID = b.nID and b.dID = $i";
>         
>         $result = mysql_query($sql, $link_id);
>         $row = mysql_fetch_row($result);
>         
>         extract($row); //the variables below match field names in this row
> 
>         echo "
>         <tr><td><h1>$headline</h1></td></tr>
>         <tr><td><h4>$subtitle</h4></td></tr>
>         <tr><td align=\"right\"><h6>$date</h6></td></tr>
>         <tr><td>$blurb</td></tr>
>         <tr><td><a href=\"news.php?#$nID\"><h5>...more</h5></a></td></tr>

The elements in $row will have indexes like $row['i.headline'], rather than 
$row['headline'], just as the columns would have those names if you ran the 
query at the command line.

(BTW, I find that doing a var_dump() or print_r() on variables--such as 
$row, in this case--to be very helpful when data isn't coming out in the 
way I expected it to...)

-- 
CC

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to