This is my favourite question. Can I clean up my 'if then' statements a tad?
Must be a cleaner way?
Still learning, still having fun :)
Thanks,
John

 $news = mysql_query($sql) or die(print "document.write(\"".mysql_error()."\");");

 $found = 0;
 while ($mydata = mysql_fetch_object($news))
 {
  if($getaddr == $mydata->IPAddress)
  {
  $found = 1;
  }
 }

  if ($found > 0)
  {
  echo "document.write(\"$getaddr already visited. \");";
  }else{
  echo "document.write(\"insert $getaddr into $table. \");";
  }




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to