Jump to content

Okay creating a function ()


whiteboikyle

Recommended Posts

Okay i have a mysql database that has a table called members..

Well in it i have their ID Username PW etc etc etc and then i have a maingame...

This main game is a ID.

Well i also have a table called gamesplayed that list gamename gamepic.

So i am trying to make a function that will show all the usernames that have each 1 of those games..

 

i already made a function to show all the pictures.. but the actual stats i cant figure out..

Here is my pic function.

function getGamePlayedPic() {
global $dbprefix;

$query = "SELECT * FROM {$dbprefix}gamesplayed";
$result = mysql_query($query)
     or die(mysql_error());
echo '<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>';
for ($i = 0; $i < mysql_num_rows($result); $i = $i + 1)
{
$gamepic = mysql_result($result, $i, "gamepic");
$gamename = mysql_result($result, $i, "gamename");
echo ("<td><div align='center'><img src=\"$gamepic\" alt=\"$gamename\"></div></td>");

}
echo '  </tr>
</table>';
}

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.