jaikar Posted December 11, 2007 Share Posted December 11, 2007 hi !.. is it possible in php to find the primary key field name of the table by giving the table name as the input? Thanks ! Link to comment https://forums.phpfreaks.com/topic/81099-how-to-identify-the-primary-key-in-the-table/ Share on other sites More sharing options...
Crew-Portal Posted December 11, 2007 Share Posted December 11, 2007 Elaborate Plz. PS When you post it will be 100th post so congrats on that! Link to comment https://forums.phpfreaks.com/topic/81099-how-to-identify-the-primary-key-in-the-table/#findComment-411515 Share on other sites More sharing options...
jaikar Posted December 11, 2007 Author Share Posted December 11, 2007 i have a code where i will give the table name as the input, now this table name is already stored from the database, so i dont know which table name will be going as an input to the function. here one more input to the funtion is the primary key of that table. and the primary key of the table is not stored in the database. so if there is any code to get the primary key from the table name, it would be helpfull and easy. any suggestions ? Thanks ! Link to comment https://forums.phpfreaks.com/topic/81099-how-to-identify-the-primary-key-in-the-table/#findComment-411517 Share on other sites More sharing options...
revraz Posted December 11, 2007 Share Posted December 11, 2007 This might help http://dev.mysql.com/doc/refman/5.0/en/table-constraints-table.html Link to comment https://forums.phpfreaks.com/topic/81099-how-to-identify-the-primary-key-in-the-table/#findComment-411521 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.