Jump to content


PHP Codeing HElp for links with mysql.


2 replies to this topic

#1 styles

    Young Padawan

  • Members
  • Pip
  • 58 posts

Posted 12 March 2006 - 08:02 PM

Ok i have my site www.CheatersDB.com now when people click on games i want them to beable to click on the game and then the game has files for that game generated by the DB that could be listed.

Now how would i do that? I have my DB's Setup:
For games i have a ID, Game Name, and Files Collums.
ID is the id of the game and Game Name is the name of it and Files is the amount of files in that game.

Now for the files i have ID, Title, Description, DirLocationForDL, Author and TimeStamp.

so for example www.CheatersDB.com/game.php?Game=CounterStrike Then it shows the files for that game.
Then they click on the file. www.CheatersDB.com/game.php?Game=CounterStrike&&ID=2 And it shows the info.

Thanks For Your Help!

Edited by styles, 12 March 2006 - 08:05 PM.


#2 coolaid

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,435 posts
  • Gender:Male
  • Interests:i wonder..

Posted 12 March 2006 - 10:39 PM

ok, you need a new column in the files to define what game it goes to. the column should be something like 'game'

then in the php page where it repeats all the files for the game, simply put something like below.

$result = mysql_query("select * from files where game = '". $_GET['game'] ."'");
while($r = mysql_fetch_array($result)){
}

but make sure that when they click on the game link have page.php?game=*gamename*

sorryif thats not what you wanted but it was pretty hard to understand your post

Edited by coolaid, 12 March 2006 - 10:39 PM.


#3 styles

    Young Padawan

  • Members
  • Pip
  • 58 posts

Posted 13 March 2006 - 12:51 AM

Ok thats kinda what i need. Its more of like.
They go to a page. Then from that page. They click on the Game. From that game it lists the cheats.

Example
At the game page they have /games.php?Game=GameName

then from there they are listed the files for that game.

Then from the files if they chose one it goes to

/games.php?Game=GameName&&File=3

and there it lists the info about the file.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users