How to get a value from a table using functions and return count

How to get a value from a table using functions and return count: Write a simple query and pass the parameters: function somename($tablename, $colnam, $colvalue, $mode, $returncolnam) { Select $returncolnam from $tablenam where $colnam=$colval } Note: For $returncolnam you can also use array number starting from 0.