Need help on uploading image from MySql Database

images php coding issues or problems here.

Moderators: macek, egami, gesf

theamol
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

<?php
$objCon=mysql_connect("localhost","root","*****") or die(mysql_error());
mysql_select_db("jci");
$sqlQry="select * from membersdetails where membershiptype='m'";
$membersDataQuery=mysql_query($sqlQry) or die(mysql_error());
$membersData=mysql_fetch_assoc($membersDataQuery);
?>

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


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

cron