PDO Get Coulmn Operation

Description

Retrives the column names from a given table

Function Reference :
 array dbGetColumnName(string $table_name);

Parameters

Name Type Required Parameter Info Example
table_name string Yes The name of the table to get column names any table name like employee_table,user_table

Examples

            <?php          
            $sdb= new SimplifiedDB(); 
            $sdb->dbConnect("localhost","username","password","dbuser");
            $result=$sdb->dbGetColumnName("users"); 
            ?> 

Result

Returns array of Columns.
If you use print_r($result_array), it will show output as in following format.

Array ( [0] => userId [1] => username [2] => password [3] => firstName [4] => lastName [5] => role_id [6] => email [7] => gender [8] => dob [9] => website [10] => city [11] => state [12] => country [13] => pincode [14] => phoneno [15] => faxno [16] => comments [17] => user_reg_date ) .

Debuging

Debug Operation Result/Output
$sdb->query DESCRIBE users
$sdb->last_insert_id
$sdb->rows_affected
$sdb->message_info Connected to database
$sdb->error_info