Re: Strange query problem php/mysql



*** 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
--
.



Relevant Pages

  • Re: populating dropdown in datagrid
    ... don't want to make a call to the db every iteration of the datagrid ... This will also fix your issue of adding the new rows to the ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Question Unified Process
    ... >>> You fix the problem. ... The iteration isn't done until the software ... > schedule and the effectiveness of the development process is monitored ... > sense that a software defect results in incorrect results. ...
    (comp.object)
  • Outlook still wraps text mails breaking URLs even after Office SP3
    ... real pain when it breaks URLs across two lines ... However it still breaks URLs at 72 chars if I set it to 132 chars ... Any ideas when MS is going to fix this rather basic but very annoying ...
    (microsoft.public.outlook.general)
  • Re: TTY loosing bytes ?
    ... Then flush_to_ldiscwill retry those bytes on the next ... iteration. ... Maybe this is not the desired patch though? ... Fix the obvious disagreement between the receive path and the receive room ...
    (Linux-Kernel)
  • How to export constants to a module?
    ... learned a ton of good stuff trying to fix it, ... Harris ... Prev by Date: ...
    (comp.lang.perl.misc)