PDO Get Columns of a table Function get columns of a table using PDOModel

Description

Get all columns of table

Function Defination

  
                                void function columnNames($dbTableName);
                                

Parameters Details

Details Type Example
$dbTableName - table name to be truncated string e.g. "emptable"

Examples

  
                                $pdomodel = new PDOModel(); //create object of the PDOModel class
                                $pdomodel->connect("localhost", "root", "", "pdocrud");//connect to database
                                /* Get all columns function */
                              $columnNames = $pdomodel->columnNames("wp_posts");         
                            

More Examples

 
                                //Example 1 

                                $columnNames = $pdomodel->columnNames("wp_posts");
                            

Result/Output

Return all column name in array format

Debug

Option Details Example
$pdomodel->getLastQuery(); Return last query executed DESCRIBE `wp_posts`
print_r($pdomodel->error) Print errors (if any)