Iam using this code to display all the column fields from database table and it works fine.

Please how do I avoid displaying column named id which is the first column in the table

$result = $db->prepare('SHOW COLUMNS from info4');

while ($row = $result->fetch()) 

echo $rw = $row[0];

1 Answers

aidinMC On Best Solutions

You can display columns one by one!

$data = $result->fetchall();
foreach($data as $row){
   echo $row['col1'];
   echo $row['col2'];