Thanks a lot for your answers, they really helped me a lot!
I'm curious of what I'm doing wrong: I can't get any values from a SQL statement.
My database table structure:
My phpcode:
include('config.php');
$id = $_GET['id'];
$query = "SELECT * FROM upload WHERE id = '$id'";
echo $query."<br/>";
$result = mysql_query($query) or die('error');
print_r($result);
echo $result['id'];
I get the following when testing:
"SELECT * FROM upload WHERE id = '1'
Resource id #2"
But there IS an id with value '2', but why doesn't it show in my html? Only with a 'while' statement I get the desired results:
while($results = mysql_fetch_array($result))
{
echo $results['filetitle'];
}
Is this while statement necessary with a single result? I mean, there can only be one ID.