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); } 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. 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. Link to comment https://forums.phpfreaks.com/topic/190166-displaying-a-clickable-playername/#findComment-1003546 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.