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
https://forums.phpfreaks.com/topic/101478-okay-creating-a-function/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.