I\'m, generating a SQL query like this in PHP:
$sql = sprintf(\"UPDATE %s SET %s = %s WHERE %s = %s\", ...);
Since almost every part of thi
Based on @jake-sully and @lukmdo answers, making a merge of their code, I finished with the following snippet:
SELECT `COLUMN_NAME` FROM `information_schema`.`COLUMNS` WHERE (`TABLE_SCHEMA` = DATABASE()) AND (`TABLE_NAME` = '') AND (`COLUMN_KEY` = 'PRI');
Hope it could help someone