I'm trying to download a PowerPoint file. I'm saving its path in column slide
in a table called lesson
. Whenever I try to download it, it downloads the whole table.
All I want is the column slide
, how can I do that?
// connect to the database
$link = mysql_connect('localhost','root','');
if (!$link) {
die('Could not connect :' . mysql_error());
}
$Selected= mysql_select_db("elearningg", $link);
if (!$Selected) {
die("Could not connect: " . mysql_error());
}
// query the server for the file
$L_ID = $_GET['id'];
$query = "SELECT * FROM lesson WHERE LID = '$L_ID'";
$result = mysql_query($query) or die(mysql_error());
// define results into variables
$name=mysql_result($result,0,"Lname");
$content=mysql_result($result,0,"slide");
header("Content-disposition: attachment; filename=$name");
echo $content;
mysql_close();