> > Is there any way to programmatically figure out
> > if a field is AUTO_INCREMENT? I can do something
> > like:
> >
> > for ($x=0; $x < $sth->numfields; $x++) {
> > $colname = $sth->name->[$x];
> > $size = $sth->length->[$x];
> > $maxlen = $sth->length->[$x];
> > $type = $sth->type->[$x];
> > }
> >
> > But from what I can tell, 'type' is a INT and
> > there is no way to tell if it is AUTO_INCREMENT
> > or not?
> >
> > Does anyone know of a way to figure out if a
> > field is AUTO_INCREMENT?
> >
>
> Take a look at mysqlshow.c
I did, and it looks like I have to re-query
the database to figure out if the field
is AUTO_INCREMENT or not ('show fields from
SOME_TABLE_NAME') and then parse the resulting
data, but I was hoping to get the info back
somewhere in the meta-data from the original
query and not have to re-query.
Any thoughts?
Jim
>
> jim...