I have a major problem that I cannot seem to get solved.
I have two databases, one called "Ranking" which is used to store my Categories for my different types of ranks. The other is called "Ranking_list" which is used to store my File Name, Title and Rankid (Primary Key of the Ranking table).
The two databases are meant to be used to display all of my categories for my ranks.
E.g. Adults, Juniors, Women, Men. - These are examples of my Ranks, and will be stored in table Ranking.
ranking.php will be used to display these categories in order, and allow them to be anchor links which when clicked will take you to list.php and list all the Files that correspond to the rank.
E.g. Adults Final, Adults 100 Meters, Adults 200 Meters - These are examples of clickable links which when clicked would prompt the user to download the relevant file.
I have created several scripts.
One to create new categories and save them into the table Ranking.
One to create new files and then select the category, and then the file is uploaded to the file structure and the name written to the Ranking_list table. Keep in mind that the categories are pulled from the Ranking table.
One to view the categories as clickable links (ranking.php)
One to view the files related to the categories (list.php)
I am fairly new to PHP and I am getting through a little, however, I cannot get the list.php to function as it should. Rather than output the list of files, it outputs "SELECT * FROM Ranking_list WHERE Rankid = 1".
if (isset($_GET['cat']) and is_numeric($_GET['cat'])){
$sqlfea = "SELECT * FROM Ranking_list WHERE Rankid = " . $_GET['cat'];
} else {
$sqlfea="Select * from Ranking_list";
As you see from the database above, Ranking_list contains the field Rankid which is the primary key in the table Ranking.
I tried to follow all the right syntax, but just cannot get the bloody thing working.
ranking.php works fine and list all the categories as it should, however, list.php does not list ANYTHING. I do not even get an error, I get one output, and that is this: SELECT * FROM Ranking_list WHERE Rankid = 1
Can ANYONE please guide me in the right direction, this is extremely important that I get this working ASAP. Help anyone please.
if (isset($_GET['cat']) and is_numeric($_GET['cat'])){
$sqlfea = "SELECT * FROM Ranking_list WHERE Rankid = " . $_GET['cat'];
} else {
$sqlfea="Select * from Ranking_list";
}
$linkfea=mysql_query($sqlfea,$db);
Bookmarks