PHP Check of SQL query for value quantities -
i have script checking values in database. there 3 instances need check for.
1) no value present 2) single value exists 3) multiple values exist
currently, have following script run first instance:
if($value){ echo ‘this showing if value exists’; }else{ echo ‘this showing if no value exists’; }
how can add check if array of values exist?
we need see code retrieves data, if have array of data use count
:
if (count($value) > 1) { // multiple values }
you may using select count
in case can compare value:
if ($value["count"] > 1) {
Comments
Post a Comment