Hello,
Just having trouble setting my $result variable to 0. The context I'm using it in is below:
switch ($flags) {
case ("1-1"):
$result = mysql_query("SELECT count(*) FROM ......");
break;
case ("1-0"):
$result = mysql_query("SELECT count(*) FROM ......");
break;
case ("0-1"):
$result = mysql_query("SELECT count(*) FROM ...... ");
break;
default:
$result = "0";
break;
}
$total = mysql_result($result, 0, 0);
This does actually do what I want it to, but I still get an unsightly warning message at the top of the screen saying:
Warning: mysql_result(): supplied argument is not a valid MySQL result resource
Basically, in all the default cases I want the $total to equal 0. So I'm trying to set the $result at 0, but think I must be using incorrect syntax.
Would be grateful for any ideas!
LizzyD