rascle Posted January 19, 2009 Share Posted January 19, 2009 Hi i am using this code: <!-- Recently Played Games Code --> <?php if($logged[id]){ $domain = $_SERVER['HTTP_HOST']; $path = $_SERVER['SCRIPT_NAME']; $queryString = $_SERVER['QUERY_STRING']; $url = "http://" . $domain . $path . "?" . $queryString; $name="test"; $playedgames = mysql_query("UPDATE members SET recentgames = '<a href=\"$url\">$name</a><br />' WHERE '$logged[username]' = `username` ");} ?> <!--End of Tag --> But instead of changing the mysql db so that the field recentgames just says "<a href="rasclerhys.com">Test</a><br />" i want it to get the previous results and add them with the new results to the db. How would i do this?? Thanks Quote Link to comment Share on other sites More sharing options...
rhodesa Posted January 19, 2009 Share Posted January 19, 2009 do you mean you want to APPEND to the recentgames field instead of setting it to something new? try this: $playedgames = mysql_query("UPDATE members SET recentgames = CONCAT(recentgames, '<a href=\"$url\">$name</a><br />') WHERE '$logged[username]' = `username` ");} Quote Link to comment Share on other sites More sharing options...
rascle Posted January 19, 2009 Author Share Posted January 19, 2009 Thanks for your suggestion. I tried it out but it did not update the mysql db even though the mysql info is correct. Quote Link to comment Share on other sites More sharing options...
rhodesa Posted January 19, 2009 Share Posted January 19, 2009 what about: $playedgames = mysql_query("UPDATE members SET recentgames = CONCAT(recentgames, '<a href=\"$url\">$name</a><br />') WHERE '$logged[username]' = `username` ") or die(mysql_error());} Quote Link to comment Share on other sites More sharing options...
rascle Posted January 19, 2009 Author Share Posted January 19, 2009 Thanks Quote Link to comment 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.