jigdesigns
30 Dec 2012, 04:09 AM
Hi guys,
Wondering if anyone can help me please, I'm fairly new to php, but do understand it all.
On my webpage, I have a login area, and on one of the sub pages, I'd like to display a list of word/pdf documents for that username.
This is all ok, but I'm not sure how to achieve the later, I have created a MySQL table with a column being a medium blob, have (I think) successfully uploaded a simple word document into the table for a test user, so when I am on my php page, I am struggling to display this file as a char string. e.g. download, then when you click on this word, the pdf/word doc opens up.
Here is my code that I'm trying.
<?php
// Get clients graphics history information
$graphhist_sql = "SELECT history_number as hist_num, init_moodboard as init_moodboard,
final_moodboard as final_moodboard FROM *****
WHERE username = '$user'";
// Execute SQL
$graphhist_query = mysql_query($graphhist_sql, $connect) or die(mysql_error() . 'Error - Could not run SQL command');
while ($graphhist_results = mysql_fetch_array($graphhist_query))
{ ?>
<div id="CLGraphicsDownloadFiles">
<table width="200" border="0" cellspacing="1" cellpadding="1">
<tr>
<th scope="col"><h3>Initial Moodboard</h3></th>
-- line in question <td><i><a href="<?php $graphhist_results['init_moodboard'] ?>" target="_blank">download</a><?php }?></i></td>
</tr>
Wondering if anyone can help me please, I'm fairly new to php, but do understand it all.
On my webpage, I have a login area, and on one of the sub pages, I'd like to display a list of word/pdf documents for that username.
This is all ok, but I'm not sure how to achieve the later, I have created a MySQL table with a column being a medium blob, have (I think) successfully uploaded a simple word document into the table for a test user, so when I am on my php page, I am struggling to display this file as a char string. e.g. download, then when you click on this word, the pdf/word doc opens up.
Here is my code that I'm trying.
<?php
// Get clients graphics history information
$graphhist_sql = "SELECT history_number as hist_num, init_moodboard as init_moodboard,
final_moodboard as final_moodboard FROM *****
WHERE username = '$user'";
// Execute SQL
$graphhist_query = mysql_query($graphhist_sql, $connect) or die(mysql_error() . 'Error - Could not run SQL command');
while ($graphhist_results = mysql_fetch_array($graphhist_query))
{ ?>
<div id="CLGraphicsDownloadFiles">
<table width="200" border="0" cellspacing="1" cellpadding="1">
<tr>
<th scope="col"><h3>Initial Moodboard</h3></th>
-- line in question <td><i><a href="<?php $graphhist_results['init_moodboard'] ?>" target="_blank">download</a><?php }?></i></td>
</tr>