P Kishor-3 wrote:
> what is the name of the column? Is it '--idcolumn--'?

That was only example written when I didn't know even for what syntax to
look for. Now problem comes to how to run SELECT against PRAGMA
table_info(tblname).

Only way out of this that I found is to run regex against the result of
sqlite_master:

$tableid = preg_match("|CREATE TABLE \"$tbl\" [(] (?<id>\w+) INTEGER PRIMARY
KEY ON CONFLICT IGNORE,|",$pdo->query("select sql from sqlite_master where
tbl_name='$tbl'")->fetchColumn(),$id) ? $id['id'] : exit("upsanerr: $id,
$tbl");
-- 
View this message in context: 
http://old.nabble.com/is-it-possible-to-return-primary-key-column-name-from-given-table---tp28432175p28437269.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to