Many thanks for the quick response. All good suggestions. I also noticed that in PHP there is a mysql_fetch_field function which returns a collection of properties about a given field, including it's name and whether it is a primary key, so with a little rejigging of my code, I'll use this. I want the script to give me table information about a database, to be able to click on a table and get all the records in it and then to be able to click on a record and edit or delete it, and I want to do it as generically as possible, so that the only parameters I need to give it are host, user, pass and db name. I got the first two no problem, and all nice and tightly coded, and in order to get the third one, I needed to find out the record id and this is why I was asking if it was possible, it would have saved another loop. Thanks again.
Paul. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]