Use SHOW COLUMNS $table_name
Read more http://dev.mysql.com/doc/refman/5.0/en/show-columns.html
HTH
Tarique
On Thu, Aug 30, 2012 at 11:45 AM, Vaibhav.Pathak wrote:
> Hi,
>
> i am facing an problem in my application, problem is that i am creating an
> function in which i have to find all fields
Hello friends,
Try below action
function abc($table_name)
{
$model_name = Inflector::classify($table_name)
App::Import('Model', $model_name);
$this->DynamicModel = new $model_name;
$table_field=$this->DynamicModel->find('all');
$this->set('$table_field' ,$table_field);
}
--
T
Hi,
i am facing an problem in my application, problem is that i am creating an
function in which i have to find all fields name in particular database
table using an function and name of the table is dynamic everytime like the
case:
function abc($table_name)
{
$table_field=$this->$table_name