0

hope everyone is fine there, i just wanted to ask that i want to display the image im storing in the database using php.. but i dont know how to display it, would i be able to retrieve it simply by echoing?? im not getting how would the whole process will go..please help..heres my code

thnx for ur time :))

 <form id="form" method="post" action="update-profile-action.php" enctype="multipart/form-data">
        <label for="Fname">First Name:</label> <input type="text" id="Fname" class="text" value="<?php echo $firstname; ?>" name="Fname" /> <br /><br />
        <label for="Lname">Last Name:</label> <input type="text" id="Lname" class="text" value="<?php echo $lastname; ?>" name="Lname" /><br /> <br />

<?php 
if ($_SESSION["type"]=="T")
{
?>        
        <label>Profile Image:</label> <input type="file" name="profileimg" value="" /><br /><br />
        <label>Qualification:</label><br />
        <textarea name="qualification" class="text" id="qualification"><?php echo $qualification;?></textarea><br /><br />
        <label>Education & Teaching History:</label><br />
        <textarea name="briefintro" class="text" id="intro"><?php echo $briefintro; ?></textarea><br /><br />
<?php
}
?>
        <input type="submit" class="mybutton" value="Update Profile" />

    </form>

and this is update-profile-action.php

<?php include("../includes/config.php");?>
<?php
$Fname=$_POST["Fname"];
$Lname=$_POST["Lname"];
$image=$_FILES["profileimg"];
$briefintro=$_POST["briefintro"];
$qualification=$_POST["qualification"];

$con=mysql_connect($dbserver,$dbusername,$dbpassword);
if (!$con) { die('Could not connect: ' . mysql_error()); }


 mysql_select_db($dbname, $con);
$query=("UPDATE accounts SET firstname='".$Fname."' , lastname='".$Lname."' ,  profileimg='".$image."' ,  briefintro='".$briefintro."',  qualification='".$qualification."' WHERE id=".$_SESSION['id']);
$result = mysql_query($query);
header("Location: update-profile.php?status=3");
mysql_close($con);
?>
3
Contributors
5
Replies
12
Views
4 Years
Discussion Span
Last Post by pritaeas
0

@websponge thanx for ur response :)
i've echoed it by the same method but its not showing the image...nor giving any type of error.. please help

0

@pirates is it necessary to move image to a folder??? im storing the image in the database using medium blob type...i cant understand, need help

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.