hy all!
big problem with a select query and switch statement.
all i want is to count a users uploads directly with this select-statement:
$resultzahl=mysql_query("SELECT count(partnerID) AS zahl, partnerID AS dbpartnerID FROM travel WHERE partnerID = '".$_SESSION['partnerID']."' GROUP BY partnerID ORDER BY zahl DESC ");
problem: if the user doesnt have uploded something the query doesnt fill me the variable $zahl because there comes NO RESULT from the db, not noll, not empty, NOTHING!
the script exits automaticly after the 3rd condition...
then the switch statement should give out the right authorization which depends on the number of uploads from the user ($zahl from db)
switch statement:
switch ($zahl){
case $zahl == 0:
$var = "do something"
break;
case $zahl <= 9:
$var = "do something"
break;
case (10<=$zahl) && ($zahl <=19):
$var = "do something"
break;
case (20<=$zahl) && ($zahl <= 29):
$var = "do something"
break;
case (30<=$zahl) && ($zahl<= 39):
$var = "do something"
break;
case (39<=$zahl) && ($zahl >= 39):
$var = "do something"
break;
}
your quick help will be really appreciated!!!!
thanks, burna