Get list of columns in table where column ‘like’ [duplicate]
This question already has answers here: MySQL query “SHOW COLUMNS FROM table like ‘columnname’” (4 answers) Closed 3 mins ago. This code returns all of the column names in a table: $result=$db->query(‘SHOW COLUMNS from TableName’); while($row=$result->fetch(PDO::FETCH_NUM)) echo $row[0].'<br>’; I need code which returns all of the column names which fit a specific pattern. Something like: […]
Get list of columns in table where column ‘like’ [duplicate]
This question already has answers here: MySQL query “SHOW COLUMNS FROM table like ‘columnname’” (4 answers) Closed 3 mins ago. This code returns all of the column names in a table: $result=$db->query(‘SHOW COLUMNS from TableName’); while($row=$result->fetch(PDO::FETCH_NUM)) echo $row[0].'<br>’; I need code which returns all of the column names which fit a specific pattern. Something like: […]