If you are using MySQL there are some functions you have to use to complete
the task.
First you must get the fields of the table:
$result= mysql_list_fields("dbname","tablename");
Second, get the number of fields in the query result :
$nFields = mysql_num_fields($result);
And finally get the last field name :
$field = mysql_field_name($result, $nFields -1); // 0 based list;
HTH
Jayme.
http://www.conex.com.br/jjeffman
-----Mensagem Original-----
De: Rubanowicz, Lisa <[EMAIL PROTECTED]>
Para: 'Cahyo S. Aji' <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Enviada em: quarta-feira, 10 de janeiro de 2001 09:23
Assunto: RE: [PHP-DB] get last field from a table
> This came from a previous listing hope it helps:
> SELECT MAX(id) FROM permission_table
>
> I am a beginner though so you may want to check for others.
> Lisa
>
> -----Original Message-----
> From: Cahyo S. Aji [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 10, 2001 10:24 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] get last field from a table
>
>
>
>
> how can i get the last field from a table?
>
> regards,
> _Ajik_
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]