Thursday, August 30, 2012

Re: regarding using dynamic table name in controller function

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 <join2vaibhav@gmail.com> 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 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->find('all');
> $this->set('$table_field' ,$table_field);
> }
>
> Please help me.
>
> Thanks
> Vaibhav Pathak
>
> --
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com.
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
>
>



--
=============================================================
PHP for E-Biz: http://sanisoft.com
=============================================================

--
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.

No comments: