Re: Tables
| From: | JJeffman | Date: | Fri, 15 Dec 2000 21:23:52 +0000 |
| Subject: | Re: Tables | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-5280@lists.php.net to get a copy of this message | ||
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@rccd.cc.ca.us>
Para: <php-db@lists.php.net>
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@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>