When i register to my site it pops up no database selected my code
mysql_connect("localhost:8080","root","") or die (mysql_error());
mysql_select_db('socialnetwork', $link) or die (mysql_error());
You need to post more code. With the use of or die(mysql_error()); its not possible to trigger a db not selected error. Instead it would trigger an invalid db or no permission error (at least I'm pretty sure its not a not selected error as that wouldn't make any sense).