Help with SQL Query and php fucntion
-
Hello,
Apologies if this is a simple question, but I’ve looked through the doc but couldn’t get it to work.
I have an SQL Query:
SELECT active_sub_count FROM wp_mepr_members WHERE user_id = %d
Which returns 0 or 1 or 2
Now I want the export to say ‘Active’ if value is 1 or greater, and if 0 say ‘Not Active’.
I assume I pass this through a php function? Which I’ve added as bb_wpae_active
then, in the function:
<?php
function bb_wpae_active($value) {
if($value == 0) {
return “Not Active”;
} else {
return “Active”;
}
}What am I doing wrong?
TIA
?>
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Help with SQL Query and php fucntion’ is closed to new replies.