Gubbins Posted January 28, 2010 Share Posted January 28, 2010 I am going wrong somewhere with the mysql_query, can someone please put me straight? $playername = mysql_query("SELECT * FROM `players` WHERE `playername` LIMIT 1"); while($f = mysql_fetch_array($playername)){ $txt = str_replace("[player]", "<a href='profile.php?player={$f['playername']}'>{$f['playername']}>", $txt); $txt = str_replace("[/player]", "</a>", $txt); } Quote Link to comment https://forums.phpfreaks.com/topic/190166-displaying-a-clickable-playername/ Share on other sites More sharing options...
premiso Posted January 29, 2010 Share Posted January 29, 2010 I am taking that you want to fetch all players: $playername = mysql_query("SELECT playername FROM `players` LIMIT 1"); Should do just fine. Quote Link to comment https://forums.phpfreaks.com/topic/190166-displaying-a-clickable-playername/#findComment-1003441 Share on other sites More sharing options...
oni-kun Posted January 29, 2010 Share Posted January 29, 2010 Yes, there is no need to have specifics unless you need to fit a variable in, you can select the columb itself. Quote Link to comment https://forums.phpfreaks.com/topic/190166-displaying-a-clickable-playername/#findComment-1003546 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.