php - Get mysql table field names in ZF2 -
I want to store the CSV data in mysql table dynamically. According to my CSV column header, I want to add data in my column to mysql table. For this, I need to get all the table field names from the Zend Framework Controller or Model.
I have tried with it:
**
$ metadata = new zend \ db \ metadata \ metadata ($ adapter); $ Table = $ Metadata- & gt; GetTable ($ tableName); $ Table & gt; GetColumns (); However, this error shows: Fatal error: class 'import' model \ zend \ db \ Metadata \ metadata not found. How do I get all mysql table field names using Zend Framework 2 ? Please help me.
You have to use a backslash before the right of the right:
$ Metadata = new \ zend \ db \ metadata \ metadata ($ adapter);
Comments
Post a Comment