Re: [PHP-DB] How to tell if a field type is auto_increment

2007-02-03 Thread John L. Creed
Ahhh, thanks. I'll do that. -- Regards, John L. Creed pcExpressWay Consulting * dBASE Gold Charter Member 210 * http://www.pcexpressway.com * Niel Archer [EMAIL PROTECTED]

Re: [PHP-DB] How to tell if a field type is auto_increment

2007-01-30 Thread John L. Creed
Here's what I did wih your help: function isAutoinc($table,$fieldname){ // returns 0 if false, 1 if true $breturn = 0; $sql = SHOW COLUMNS FROM $table LIKE '$fieldname%' ; $result = mysql_query($sql) or die(Couldn't open table); // check column Extra $row = mysql_fetch_array( $result );

Re: [PHP-DB] How to tell if a field type is auto_increment

2007-01-30 Thread Niel Archer
Hi John, I'd suggest searching within the Extra field instead of testing for the value explicitly, as this field can theoretically hold several extra pieces of information. Niel -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] How to tell if a field type is auto_increment

2007-01-29 Thread Niel Archer
Hi Try using: SHOW COLUMNS FROM db.table LIKE 'field_name%' and from the returned row, check the 'Extra' column for 'auto_increment' Niel -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] How to tell if a field type is auto_increment

2007-01-29 Thread John L. Creed
Thanks a Million my Friend. I've been struggling with this for days now grin -- Regards, John L. Creed pcExpressWay Consulting * dBASE Gold Charter Member 210 * http://www.pcexpressway.com