I'm creating a landing page with only one file. Let's say index.php.
Index.php is able to alter its information by calling different values from a MySQL db, which has only two fields: "top" & "type".
I initially want to show ALL of the data. Links on the page will only sort specific data from either $top or $type.
I can sort the data by doing the following:
$top = $_GET['top'];
$type = $_GET['type'];
$result = mysql_query( "SELECT * FROM table WHERE top='$top' OR type='$type' ORDER BY name" )
The problem is the initial page doesn't pull ANY data. Once I click a link:
index.php?top=1
index.php?type=berries
... I get some data.
HOW do I pull ALL of the data when the page initially loads? I think it has something to do with an include() tag but nothing seems to be working.
TIA.
Index.php is able to alter its information by calling different values from a MySQL db, which has only two fields: "top" & "type".
I initially want to show ALL of the data. Links on the page will only sort specific data from either $top or $type.
I can sort the data by doing the following:
$top = $_GET['top'];
$type = $_GET['type'];
$result = mysql_query( "SELECT * FROM table WHERE top='$top' OR type='$type' ORDER BY name" )
The problem is the initial page doesn't pull ANY data. Once I click a link:
index.php?top=1
index.php?type=berries
... I get some data.
HOW do I pull ALL of the data when the page initially loads? I think it has something to do with an include() tag but nothing seems to be working.
TIA.