Select all columns except one in MySQL?

后端 未结 30 2860
后悔当初
后悔当初 2020-11-22 00:46

I\'m trying to use a select statement to get all of the columns from a certain MySQL table except one. Is there a simple way to do this?

EDIT: There are 53 columns i

30条回答
  •  抹茶落季
    2020-11-22 01:08

    Just do

    SELECT * FROM table WHERE whatever
    

    Then drop the column in you favourite programming language: php

    while (($data = mysql_fetch_array($result, MYSQL_ASSOC)) !== FALSE) {
       unset($data["id"]);
       foreach ($data as $k => $v) { 
          echo"$v,";
       }      
    }
    

提交回复
热议问题