Mysql Get Coulmn Operation

Description

Retrives the column names from a given table

Function Reference :
resource/array dbGetColumnName(string $table_name);

Parameters

Name Type Required Parameter Info Example
table_name string Yes The name of the table to insert new records any table name like employee_table,user_table

Examples

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

Result

Returns mysql result set by default. You can set $sdb->output_array=true, to return array as output.
If you use print_r($row) in
while($row = mysql_fetch_array($result)) {
print_r($row);
}
it will show output as in following format.

Array ( [0] => userId [COLUMN_NAME] => userId ) Array ( [0] => username [COLUMN_NAME] => username ) Array ( [0] => password [COLUMN_NAME] => password ) Array ( [0] => firstName [COLUMN_NAME] => firstName ) Array ( [0] => lastName [COLUMN_NAME] => lastName ) Array ( [0] => role_id [COLUMN_NAME] => role_id ) Array ( [0] => email [COLUMN_NAME] => email ) Array ( [0] => gender [COLUMN_NAME] => gender ) Array ( [0] => dob [COLUMN_NAME] => dob ) Array ( [0] => website [COLUMN_NAME] => website ) Array ( [0] => city [COLUMN_NAME] => city ) Array ( [0] => state [COLUMN_NAME] => state ) Array ( [0] => country [COLUMN_NAME] => country ) Array ( [0] => pincode [COLUMN_NAME] => pincode ) Array ( [0] => phoneno [COLUMN_NAME] => phoneno ) Array ( [0] => faxno [COLUMN_NAME] => faxno ) Array ( [0] => comments [COLUMN_NAME] => comments ) Array ( [0] => user_reg_date [COLUMN_NAME] => user_reg_date ) Array ( [0] => visits [COLUMN_NAME] => visits ) Array ( [0] => user_id [COLUMN_NAME] => user_id ) Array ( [0] => login_name [COLUMN_NAME] => login_name ) Array ( [0] => passward [COLUMN_NAME] => passward ) Array ( [0] => first_name [COLUMN_NAME] => first_name ) Array ( [0] => last_name [COLUMN_NAME] => last_name ) Array ( [0] => email [COLUMN_NAME] => email ) Array ( [0] => company [COLUMN_NAME] => company ) Array ( [0] => addr_line1 [COLUMN_NAME] => addr_line1 ) Array ( [0] => city [COLUMN_NAME] => city ) Array ( [0] => state [COLUMN_NAME] => state ) Array ( [0] => country [COLUMN_NAME] => country ) Array ( [0] => pin [COLUMN_NAME] => pin ) Array ( [0] => phone [COLUMN_NAME] => phone ) Array ( [0] => user_type [COLUMN_NAME] => user_type ) Array ( [0] => user_status [COLUMN_NAME] => user_status ) Array ( [0] => Registration_date [COLUMN_NAME] => Registration_date ) Array ( [0] => last_login_date [COLUMN_NAME] => last_login_date ) Array ( [0] => Registration_ip [COLUMN_NAME] => Registration_ip ) Array ( [0] => active_code [COLUMN_NAME] => active_code ) Array ( [0] => fax [COLUMN_NAME] => fax ) Array ( [0] => ref_name [COLUMN_NAME] => ref_name ) Array ( [0] => ref_city [COLUMN_NAME] => ref_city ) Array ( [0] => ref_country_id [COLUMN_NAME] => ref_country_id ) Array ( [0] => s_company [COLUMN_NAME] => s_company ) Array ( [0] => s_address1 [COLUMN_NAME] => s_address1 ) Array ( [0] => s_address2 [COLUMN_NAME] => s_address2 ) Array ( [0] => s_city [COLUMN_NAME] => s_city ) Array ( [0] => s_state [COLUMN_NAME] => s_state ) Array ( [0] => s_pin [COLUMN_NAME] => s_pin ) Array ( [0] => s_country_id [COLUMN_NAME] => s_country_id ) Array ( [0] => s_person_atten [COLUMN_NAME] => s_person_atten ) Array ( [0] => s_phone [COLUMN_NAME] => s_phone )

Debuging

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