php-db | 2000121

Re: [PHP-DB] Tables From: JJeffman (jjeffmanweb <email protected>)
Date: 12/15/00

I guess this is not what you actually is looking for. Imagine you get 20000
records, how can you remember which record position you want to get ? It's a
matter of methodology, we always search records by some of its field values.
You look for a record where some of its fields has a known value, this way
you shouldn't remember the record position :

$query = "select * from Customers where CustomerID = $custID" ;
$result = mysql_query($query);
if($result){
    $custm = mysql_fetch_array($result);
    // Now you get the field by name you want:
    echo($custm["CustomerID"]);
    echo($custm["CustomerName"]);
    ...
}

Jayme.

http://www.conex.com.br/jjeffman

-----Mensagem Original-----
De: Julio Cuz, Jr. <jcuz <email protected>>
Para: <php-db <email protected>>
Enviada em: sexta-feira, 15 de dezembro de 2000 15:42
Assunto: [PHP-DB] Tables

> Hi--
>
> Let's say I have a table named 'Customers' with 10 rows of data and a
total
> of 3 fields...
>
> Is there a way to tell PHP to get the information from "X" row and a field
> named "Y"? For example: function(row_number, field_name)?
>
> Thanks!
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe <email protected>
> For additional commands, e-mail: php-db-help <email protected>
> To contact the list administrators, e-mail: php-list-admin <email protected>
>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe <email protected>
For additional commands, e-mail: php-db-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>