I get this error:
Warning: Unable to jump to row 0 on MySQL result index 2
when the data doesn't exist in the query:
$result = mysql_query($sql) or die("Couldn't execute query.");
if ($filename = mysql_result($result,0, "filename") ){
echo "$filename";
}
The query works, and so it doesn't die, but the mysql_result(); is null, so how do I get around this?