maxso Posted December 23, 2008 Share Posted December 23, 2008 I have a problem where it says Parse error: parse error, unexpected $ in /home/www/cooladverts.freehostia.com/index.php on line 26 It says the last line which is </html> <html> <head /> <body> <?php $ip=$_SERVER['REMOTE_ADDR']; $con=mysql_connect('****************','******','******'); mysql_select_db('*****'); $get=mysql_query("SELECT ip FROM server1 WHERE IP='$ip'"); $ip_exist=mysql_num_rows($get); $add_new=mysql_query("INSERT INTO server1 (IP, count) VALUES ('$ip', '1')"); if($ip_exist > 0){ echo "welcome again"; } else { echo "new user"; ?> </body> </html> This only happened when I added this part of the script $add_new=mysql_query("INSERT INTO server1 (IP, count) VALUES ('$ip', '1')"); Am I missing a bracket or something? Link to comment https://forums.phpfreaks.com/topic/138228-solved-am-i-missing-a-bracket-somewhere/ Share on other sites More sharing options...
Maq Posted December 23, 2008 Share Posted December 23, 2008 Never closed your ELSE statement. I remember posting this for you before... if($ip_exist > 0){ echo "welcome again"; } else { echo "new user"; } ?> Link to comment https://forums.phpfreaks.com/topic/138228-solved-am-i-missing-a-bracket-somewhere/#findComment-722684 Share on other sites More sharing options...
maxso Posted December 23, 2008 Author Share Posted December 23, 2008 Tis not my day today. solved Link to comment https://forums.phpfreaks.com/topic/138228-solved-am-i-missing-a-bracket-somewhere/#findComment-722687 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.