I want to create a function to call a key and value on specific table.
Basically my statement like this
$query = 'SELECT SQL_CALC_FOUND_ROWS
'.$key.'
FROM users
WHERE
status="'.$value.'"';
Now I want implement in function
function counter('what to put here') {
$query = 'SELECT SQL_CALC_FOUND_ROWS
'.$key.'
FROM users
WHERE
status="'.$value.'"';
if (!($result = @mysql_query($query))) {
die(mysql_error());
}
$rows = mysql_fetch_assoc(mysql_query('SELECT FOUND_ROWS() AS rows'));
return $rows['rows']; // what to return here
}
And to call the function
<?php echo counter('KEY','VALUE'); ?>
Let me know how to achieve my goal..