Ok i am guessing there is a min(id) too. This is what i have:
$gid="SELECT min(id) FROM post";
$gid2=mysql_query($gid);
$gid3=mysql_fetch_array($gid2);
$l=$gid3['id'];
and i end up with the index 'id' undefined. Not sure why i get this error. it seems to work with normal varchar fields but maybe not int autoincrement fields?