Jump to content

[SOLVED] Add to MySQL


rascle

Recommended Posts

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

Link to comment
Share on other sites

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` ");}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.