Need help on uploading image from MySql Database

images php coding issues or problems here.

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 2
Joined: Tue Jul 20, 2010 3:07 am

Need help on uploading image from MySql Database

Postby theamol » Tue Jul 20, 2010 3:18 am

Hi All, please help me out. i am following issue.

i have designed a page called "membersinfo.php". code is something like below..

Code: Select all

$objCon=mysql_connect("localhost","root","*****") or die(mysql_error());
$sqlQry="select * from membersdetails where membershiptype='m'";
$membersDataQuery=mysql_query($sqlQry) or die(mysql_error());

<?php do {?>
<p class="menubar"><a href="membersinfo.php?memberid=<?php echo  $membersData['id']; ?>" class="menubar">
<?php echo $membersData['firstname']; ?>
<?php echo $membersData['lastname']; ?>
<?php } while ($membersData=mysql_fetch_assoc($membersDataQuery))?>
                       </table>           </td>
<td width="442" align="left" valign="top" style="padding: 5px 0px;">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <td width="8%">&nbsp;</td>
                    <td width="92%">                                         <?php
               if ($_GET['memberid']>0)
<td width="202" valign="top"><table width="100%" height="100%" border="0" cellspacing="0" cellpadding="15">
                    <td height="100%" valign="top" class="rightbar"><p style="margin-top:0px;"><?php header('content-type: image/jpeg'); $image=$membersData['image'];
echo $image; ?></p></td>

now the issue above code is that it gives message regarding header as i have already included some php file. and i am not able to upload image from database. please help me and provide me a solution.

Return to “PHP coding => Images”

Who is online

Users browsing this forum: No registered users and 1 guest