I have a page which displays applications in a table from my database. Each one of these titles cant be clicked to go to there indervidual page so the full application can be read (example: application.php?ID=1)
That works fine but now i want the page to displayed all the columns for that id row (title,description etc.)
In logic i can do it in my head but putting it down onto php i only got this far (with help of tutorial of course)
Code: Select all
<?php
# connect to the database
mysql_connect('localhost','******,'*******');
mysql_select_db('Mini');
session_start();
$my_id = trim (' ' . @$_GET['ID']) ; // will always return a result -- uses '
// sanitize/ clean data value: check for integer value, generate the corresponding string
if ('' < $my_id) { $my_id= (int) $my_id; // extract integer value -- uses '
if ( 0 == $my_id) { $my_id= ''; //handle as empty -- uses '
} else $my_id = "$my_id"; // uses "
}
if ('' == $my_id) { //handle the case where no ?ID= present
} else { //we have a ID=some integer >0
$result = mysql_query("SELECT * FROM fulldata WHERE ID = '$id'") // This will return one result
or die(mysql_error());
}
while($row = mysql_fetch_array($result))
{
echo $row['title'] . " " . $row['descript'];
echo "<br />";
}
?>