Posted by Bob Stearns on 09/26/05 22:11
The problem is that some functioning (I thought) code has stopped working:
$n = @odbc_num_rows($res);
$debug .= "<br>isset(n) " . $code . "=" . isset($n) . ";<br>";
$debug .= "<br>ncode " . $code . "=$ncode;<br>";
$debug .= "<br>n " . $code . "=$n;<br>";
switch ($ncode) {
case -2: /* 0 or 1 */
if(!isset($n) || (($n!=0) && ($n!=1))) {
$debug .= "<br>-2 " . $code . "=-2;<br>";
$myerr = TRUE;
$mymsg .= $code . " " . $msg . "<br><br>";
}
break;
case -1: break; /* don't care */
case 0: /* exactly 0 *\
if(!isset($n) || ($n!=0)) {
$debug .= "<br>0 " . $code . "=0;<br>";
$myerr = TRUE;
$mymsg .= $code . " " . $msg . "<br><br>";
}
break;
case 1: /* exactly one */
if(!isset($n) || ($n!=1)) {
$debug .= "<br>1 " . $code . "=1;<br>";
$myerr = TRUE;
$mymsg .= $code . " " . $msg . "<br><br>";
}
break;
case 2: /* at least one */
if(!isset($n) || ($n<1)) {
$debug .= "<br>2 " . $code . "=2;<br>";
$myerr = TRUE;
$mymsg .= $code . " " . $msg . "<br><br>";
}
break;
}
gives the following output:
isset(n) V ID=1;
ncode V ID=0;
n V ID=0;
1 V ID=1;
myerr=1; mymsg=V ID res-03 is already known id
which indicates case 1 was executed when case 0 was called for.
Navigation:
[Reply to this message]
|