PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Just want to ask y there is no output in the If condition:
<?
include("conf/config.php");
$link = mysql_connect($database['host'],$database['username'],$database['password']);
mysql_select_db($database['name'],$link);
$rs4 = mysql_query("SELECT IP4 FROM ipadd ORDER BY IP4")or die(mysql_error());
$info4 = (mysql_fetch_array( $rs4 ));
$ctr=31;
if ($ctr != 31) {//if ctr is equal to the 1st value of IP4 field in the database
Print "<b>The IP is available:</b> ".$info4['IP4']. " <br>";
}
else
{
//Print "<b>IP4:</b> ".$info4['IP4']. " <br>";
$ctr++;
Print "The value of ctr is ";
Print $ctr; //value of ctr is 32
while($info4 = mysql_fetch_array( $rs4 ))
{
$ctr++;
Print "<br> <b>IP4:</b> ".$info4['IP4']. " <br>";
Print "The value of ctr is ";
Print $ctr;
if ($ctr==$info4['IP4'])
{
print "It is equal "; //Doesn't output at all
print $ctr;
}
/*
else
{
print "Finally, its not";
$ctr;
}
*/
}
}
?>
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]