Jump to content

[SOLVED] If statement issue


refiking

Recommended Posts

Here's the code.  The script in and of itself works fine.  It's this section here. Once again, everything else works fine.  When I echo $num and $limit, I get 4 and 3 just like I am supposed to.

$limit = $_POST['limit'];
$value = $_POST['value'];
IF ($value != ""){
$cl = mysql_query("SELECT * FROM `data` WHERE `$value` = 'yes'")or die(mysql_error());
$num = mysql_num_rows($cl);

}
IF ($num > $limit){
     Echo 'It is workin';
}

Try this just to make sure...

 

$limit = $_POST['limit'];
$value = $_POST['value'];
IF ($value != ""){
$cl = mysql_query("SELECT * FROM `data` WHERE `$value` = 'yes'")or die(mysql_error());
$num = mysql_num_rows($cl);

}

$num = 4;
$limit = 3;

IF ($num > $limit){
     Echo 'It is workin';
}

you never did really tell us the problem.....

 

you pretty much just said....IF statement don't work (*in a hillbilly accent* to make a point)

 

what doesn't work about it...are you getting errors...are the values empty, is the page blank, is the ECHO not echoing....

I'd assume the echo is working but...well....Maq as pretty much solved that idea

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.