Hi everyone, am trying to save excel/docs filename in mysql and then display the filename and open the file to edit. The filename can be save in mysql but unable to display the filename and open the file. Appreciate if you could advise. Thanks a lot.
<div id="tabs-1"> <?php
error_reporting(E_ALL ^ E_NOTICE);
$con = mysql_connect("localhost","user","");
if (!$con){
die("Can not connect: " . mysql_error());
}
mysql_select_db("pq",$con);
$Picid = $_GET['Picid'];
$nwQty = "SELECT * FROM progress WHERE Picid = '$Picid'";
// check if the progress is already
$solution = mysql_query($nwQty);
if(isset($_POST['submit'])){
if (mysql_num_rows($solution) == 0){
// put the progress in table
$sql = "INSERT INTO progress(Attachment1,Attachment11,
Picid) VALUES ('" . $_POST["Attachment1"] . "','" . $_POST["Attachment11"] . "','" . $Picid . "')";
$result = mysql_query($sql);
} else {
// update progress in table
$sql =("UPDATE progress SET Attachment1='" . $_POST["Attachment1"] . "',
Attachment11='" . $_POST["Attachment11"] . "' WHERE Picid='" . $Picid . "'");
$result = mysql_query($sql);
echo('Record Updated');
}
$result = mysql_query("SELECT * FROM progress WHERE Picid='$Picid' ");
$row= mysql_fetch_array($result);
}
?> <form name="progress" id="progress" method="post" action=""> <p><ENCTYPE="multipart/form-data">Forms: <input type="file" name="Attachment1" id="Attachment1" MAXLENGTH=50 ALLOW="text/*" value="<?php echo $row['Attachment1']; ?>"></p> <p><ENCTYPE="multipart/form-data">Department Forms: <input type="file" name="Attachment11" id="Attachment11" MAXLENGTH=50 ALLOW="text/*" value="<?php echo $row['Attachment11']; ?>"></p> <input type="hidden" name="Picid" id="Picid" value="<?php echo $row['Picid']; ?>" > <td colspan="2"><input type="submit" name="submit" id="submit" value="Save" class="btnSubmit"></td> <?php
mysql_close($con);
?> </div> </form>