Mysql Get Variable Single Value Operation

Description

Get single value for the coulmn passed as variable

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

Parameters

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 in which where condition given in form of associative array. array("gender"=>"male")

Examples

 
	        <?php 
            $sdb= new SimplifiedDB(); 
            $sdb->dbConnect("localhost","username","password","dbuser"); 
            $result=$sdb->dbGetVariable("users","username",array("userId"=>1)); 
            if($result=="userInputPassword")
				echo "Password is correct";
			else
				echo "Password is in-correct";
            ?> 
            

Result

Returns variable(columnname) value. For the above example...,if it matches with the userInputPassword then it will show
Password is correct

Debuging

Debug Operation Result/Output
$sdb->query SELECT `password` FROM `users` WHERE `userId`= '1'
$sdb->last_insert_id
$sdb->rows_affected
$sdb->message_info Connected to database
$sdb->error_info