Posted by Jim Michaels on 11/21/00 11:37
if you don't need the "no records found", you can remove it like this:
$recset = mysql_query("SELECT * FROM TABLENAME",$db_conn) or die("Error
message if query
fails");
while($row = mysql_fetch_array($recset)) {
//put output code with $row['XML'] here
echo $row['XML'];
echo "here is some $row[XML]\n";
}
(I am used to using mysql_fetch_array - the other function does the same
thing anyway - your choice)
"Snappy" <freethot@libertyhaven.com> wrote in message
news:1136868122.600214.165390@g14g2000cwa.googlegroups.com...
> Try this:
>
> $query = "SELECT * FROM TABLENAME"; //or whatever SQL you want to use
> $recset = mysql_query($query,$db_conn) or die("Error message if query
> fails");
> if( mysql_num_rows($recset) < 1 )
> {
> // no records found for query
> }
> else
> {
> while( $row = mysql_fetch_assoc($recset) )
> {
> //put output code here
> }
> }
>
> If you are using a table to display the records make sure to put the
> table tag and its heading row before the while statement and put the
> closing table tag after the while block. Inside the while loop you
> would code the output for an entire table row.
>
> More help available at http://www.php.net/manual/en/ref.mysql.php look
> up MySQL functions under Functions Reference on sidebar.
>
Navigation:
[Reply to this message]
|