This is what I would do. As inefficient as this is, I would do it.
Make a table for say N64.
So console_n64 was the table name.
The fields are id,letter,name,cheats
Make the ID field auto_increment for counting purposes. It is always good to know how many cheats you have.
Ok so. Say you put in the game Harvest Moon.
ID ---- LETTER------NAME ----------------Cheats
1 ---- H ----------- Harvest Moon 64 --- BLAH BLAH BLAH
Ok so then you would have something like this.
<a href="n64.php?letter=H">H</a> Then on this H page you do this.
Code: Select all
<?php
$query = "SELECT * FROM console_n64 WHERE letter = '.$_GET['letter'].' ORDER BY id DESC LIMIT 0, 50";
$result = MySQL_query($query);
While( $rows = MySQL_fetch_assoc($result) ) {
$name = $rows['name'];
echo "<a href="n64game.php?game={$name}">{$name}</a>\n";
}
?>
Now that code would list all the games with the letter chosen in the n64 table. On the actual page to list the cheats you would do the same thing but the query changes from
WHERE letter = '.$_GET['letter'].'
to
WHERE name = '.$_GET['name'].'
and you would add $cheats = $rows['cheats']; after the $name declaration. And you would take out the link and put
echo $name;
echo "<br>{$cheats}\n";
<b>Please note there's most likely errors

</b>
Another thing. If you're using phpMyAdmin, an idea you could do to learn about queries is to click the sql tab and have some fun. Learn how to select a specific game using SQL code. Trust me. It pays off
