<?php
$ip = $REMOTE_ADDR;
$connect = MYSQL_CONNECT($host,$user,$password) or die ("could not connect");
MYSQL_SELECT_DB($database);
$query = "Insert into $table values('$ip')";
MYSQL_QUERY($query);
MYSQL_Close($connect);
This will open the database and enter an ip address in a table with 1 field... the ip field.
Hope this Helps!