You\'re missing \"database_connect_file.php\" which you included in your hits_viewer.php. Also you should add an index for your \"ip\" field in your database since you\'re selecting on that field so much. After you get a lot of data this will become essential as it\'ll get very slow.
I also recommend including an auto_increment hit_id to your table so every one has a unique identifier. It also wouldn\'t hurt to add a timestamp field so every item will automatically be assigned a date upon modification. It\'s good to also have date, but it should be of the type \"Date\", not varchar.