PDO Get Single Value Of Coulmn Operation


Get single value for the coulmn passed as variable.

Function Reference :
       			array dbGetVariable($tablename,$variable[, array $select_where_condition=array()]) 


Name Type Required Parameter Info Example
table_name string Yes The name of the table to select records any table name like employee_table,user_table
variable string Required The coulmn name of the table "username" or "gender"
select_where_condition associative array Optional Associative array with key as column name and values as column value for where clause array("gender"=>"male")


                  $sdb= new SimplifiedDB(); 


Returns array of values. You can define which type of array you needs using $sdb->fetch_mode="ASSOC" or $sdb->fetch_mode="NUM" etc. By default, it retrives associative array.

If you use print_r($result_array), it will show output as in following format.
Array ( [0] => Array ( [username] => Ram ) )


Debug Operation Result/Output
$sdb->query SELECT `username` FROM `users` WHERE `userId`=?
$sdb->message_info Connected to database

More Examples

            	// Most basic example, selecting all columns and rows of table 'users'