0

My "Users" table has many many fields, including the password field. So, if I want to select a user and get ALL the information, how can I do this in Zend but excluding the password field? I know I can manually type in all the fields, but I was wondering if there is a way to exclude one field?

Thanks Kousha

user1083320
  • 1,836
  • 8
  • 22
  • 29
  • there are few suggestions in this post [Select all columns except one in MySQL?](http://stackoverflow.com/questions/9122/select-all-columns-except-one-in-mysql) – Nandakumar V Nov 17 '12 at 05:51

1 Answers1

1

I'm not sure that this is an efficient way to do this (I believe the meta data can be cached), but you could use Zend_Db_Table to get the columns, then just remove the password column.

Would look something like this:

$info = $table->info();
$columns = $info['cols'];
unset($columns[array_search('password', $columns)]);
//you can now pass $columns to a Zend_Db_Select
Tim Lytle
  • 17,549
  • 10
  • 60
  • 91