Re: Database help
| From: | Jef | Date: | Tue, 08 Oct 2002 18:22:40 +0000 |
| Subject: | Re: Database help | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-119313@lists.php.net to get a copy of this message | ||
The code works fine for displaying the information in the database. However,
the first line of information is still skipped.
Jef
++++++++++++++++++++++++++++++++++++++++++++++++++++++
"Davy Obdam" <info@davyobdam.com> wrote in message
news:000801c26e63$8622cb00$9600000a@davy...
> Hi Jef,
>
> This is what i would do:
>
> $fSelect = "SELECT lot,size,price FROM properties WHERE status =
> 'Available' ORDER BY lot ASC";
> $fSql = mysql_query($fSelect, $db) or DIE("Unable to retrieve data");
> for ($i=0;$i<mysql_num_rows($sql_id);$i++)
> {
> $useFields = mysql_fetch_assoc($fSql);
> file://Your table
> echo "<td>".$useFields['lot']."</td>";
> file://The rest of your table
> }
>
> I hope this helps
>
> Best regards,
>
> Davy Obdam,
> mailto:info@davyobdam.com
>
>
>
>
> -----Original Message-----
> From: Jef [mailto:dragonr@xmission.com]
> Sent: Tuesday, October 08, 2002 12:53 AM
> To: php-general@lists.php.net
> Subject: [PHP] Database help
>
>
> I am querying a database to populate a list. The list is suppose to
> start with the first line of information in the database and continue
> untill have been displayed.
>
> The problem I am having is the first line in the database is not being
> displayed. The display starts on the second line.
>
> Here are the MySQL commands to retrieve the data...
>
> $fSelect = "SELECT lot,size,price FROM properties WHERE status =
> 'Available' ORDER BY lot ASC"; $fSql = mysql_query($fSelect, $db) or
> DIE("Unable to retrieve data"); $useFields = mysql_fetch_array($fSql,
> MYSQL_ASSOC);
>
> The next line prints the lot field to the screen. The number printed to
> the screen is the second lot number that matches this database query.
>
> Any suggestions on how to get the first information displayed to the
> screen?
>
>
>
>
> Jef
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> ================================================================
> Deze e-mail is door E-mail VirusScanner van Planet Internet
> gecontroleerd op virussen. Op http://www.planet.nl/evs staat
> een
> verwijzing naar de actuele lijst waar op wordt gecontroleerd.
>
>
>