[thelist] php (if/else)

john corry john at neoncowboy.com
Tue Jun 19 20:32:18 CDT 2001


uhh...

I have a weird thing going on..
$max_art_id = mysql_num_rows($id_result);
	echo ("there are $max_art_id rows in the DB.<br>");
	// if current art_ID == max_art_ID
		if ($cur_id == $max_art_id){
		// next link goes to first record (art_ID[0])
		$next = 1;
		echo ($next);
		} else {
			// else
		$next = ($cur_id++)	;
		echo($next);
		}

This si weird because in the line that echos $max_art_id, it writes the
correct value, 31. But then in the if() statement, I evaluate it to see if
its the same as $cur_id (which is 1)...it's supposed to do the 'else' but it
doesn't, it evaluates to true, even though it isn't...

What's going on?

jc





More information about the thelist mailing list