hi,
just go thru ur code once u'll getout with the bug.
$myrow<>mysql_fetch_Array($result2);
what is $myrow and to which value should the left part should
compare.
try this :
<?php
file://Connect to db
$db = mysql_pconnect("localhost","login","pass");
mysql_select_db("database",$db);
file://Check for the IP
$result2 = mysql_query("SELECT ip FROM ip where ip = '$REMOTE_ADDR'",$db);
$myrow=mysql_fetch_Array($result2);
if($myrow)
// if there is a record then the code goes here
else
echo("print some text here");
?>
/sagar
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, September 06, 2001 2:09 PM
Subject: [PHP] mysql_fetch_array
Can someone tell me what i'm doing wrong here?
<?php
file://Connect to db
$db = mysql_pconnect("localhost","login","pass");
mysql_select_db("database",$db);
file://Check for the IP
$result2 = mysql_query("SELECT ip FROM ip where ip = '$REMOTE_ADDR'",$db);
while($myrow<>mysql_fetch_array($result2))
{
echo "Print some text here!";
}
?>
Basically I just want to print text if the IP address was not found in the
database, and if it was found then I want to print "Print some text here!"
Please help!
Thanks,
Nate
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]