[RESOLVED] searching a db!
Hi I just made a login script that actually works, lol :) It stores the data in a db called user. That table has 4 fields. id, user, pass and ip. When i log in on my page my ip is stored in the tabel. But here is some code im doing on another page. I need some help!
PHP Code:
mysql_connect('', '', ''); //<--- connects to sql
mysql_select_db(''); // <--- selects db
$ip = $_SERVER['REMOTE_ADDR']; //<--- gets your ip address
mysql_query("SELECT * FROM user ORDER BY id")
if (***$ip is found somewhere in db***){ // <---I don't know how to make that query!
echo "you are logged in"
}
else {
echo "Gotta log in first!"
;
}