Re: Strange query problem php/mysql
- From: Alvaro G Vicario <alvaro_QUITAR_REMOVE@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 6 May 2005 10:01:29 +0200
*** smilesinblues@xxxxxxxxx wrote/escribió (5 May 2005 06:38:19 -0700):
> <?php do { ?>
> <tr>
> <td><?php echo $serialid++; ?></td>
> <td><?php echo $row_mostwanted['song']; ?> - <?php echo
> $row_mostwanted['hits']; ?></td>
> <td><?php echo $row_mostwanted['artist']; ?></td>
> </tr>
> <?php } while ($row_mostwanted = mysql_fetch_assoc($mostwanted)); ?>
You first use $row_mostwanted before giving it any value, so in the first
iteration its contents are unpredictable. Fix this first.
Also, it's a good idea to always use htmlspecialchars() to output text into
HTML, otherwise you may face problems when your strings contain certain
chars.
--
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
.
- References:
- Strange query problem php/mysql
- From: smilesinblues
- Re: Strange query problem php/mysql
- From: Alvaro G Vicario
- Re: Strange query problem php/mysql
- From: smilesinblues
- Re: Strange query problem php/mysql
- From: Alvaro G Vicario
- Re: Strange query problem php/mysql
- From: smilesinblues
- Strange query problem php/mysql
- Prev by Date: Re: thumbnail image from a web link
- Next by Date: Re: Strange query problem php/mysql
- Previous by thread: Re: Strange query problem php/mysql
- Next by thread: Re: Strange query problem php/mysql
- Index(es):
Relevant Pages
|