WeLoveCSS Logo
Home Profile Members Search Rules Help New Posts



WeLoveCSS > PROGRAMMING LANGUAGES > Scripting and Server Side > Why image not showing (from mysql) database using php? other files are ok.

Reply
  Thread Tools Display Modes
Old 19th February 16, 10:53 AM   #1
software_ss
WLC Member
 
Join Date: May 2015
Posts: 6
Default Why image not showing (from mysql) database using php? other files are ok.

I am not able to view image using id. When other fields are showing by php then why image is not? please help.

here image field name is 'std_img' in blog.

codes are
Code:
<link href="src/facebox.css" media="screen" rel="stylesheet" type="text/css" />
   <script src="lib/jquery.js" type="text/javascript"></script>
  <script src="src/facebox.js" type="text/javascript"></script>
  <script type="text/javascript">
    jQuery(document).ready(function($) {
      $('a[rel*=facebox]').facebox({
        loadingImage : 'src/loading.gif',
        closeImage   : 'src/closelabel.png'
      })
    })
  </script>

<?php
				include('../connect.php');
				$id=$_GET['id'];
				$result = mysql_query("SELECT * FROM student where id='$id'");
				while($row = mysql_fetch_array($result))
					{
						$id=$row['id'];
						$std_name=$row['std_name'];
						$std_fname=$row['std_fname'];
						$std_mname=$row['std_mname'];
						$std_address=$row['std_address'];
						$std_dob=$row['std_dob'];
						$std_gender=$row['std_gender'];
						$std_religion=$row['std_religion'];
						$std_nationality=$row['std_nationality'];
						$std_cellno=$row['std_cellno'];
						$std_fcellno=$row['std_fcellno'];
						$do_admission=$row['do_admission'];
						$std_department=$row['std_department'];
						$std_username=$row['std_password'];
						$std_img=$row['std_img']; 
					}
				?>	

<style type="text/css">
<!--
.ed{
border-style:solid;
border-width:thick;
border-color:#00CCFF;
padding:5px;
margin-bottom: 4px;
}
#button1{
text-align:center;
font-family:Arial, Helvetica, sans-serif;
border-style:solid;
border-width:thin;
border-color:#00CCFF;
padding:5px;
background-color:#00CCFF;
height: 34px;
}
-->
</style>
<!--   <form name="myForm" action="addstudexec.php" method="post" enctype="multipart/form-data" name="addroom" onsubmit="return validateForm()">    -->

<center>

<table width="609" border="1">
  <tr>
    <td width="114">Id Number</td>
    <td width="355"><?php echo $id?></td>
    <td width="118" rowspan="4">
    
    <?php 
	echo '<img height="200px" width="200px" src="data:image;base64,'.$std_img.'">';
	?>
    
    
     </td>
  </tr>
  <tr>
    <td>Student's Name</td>
    <td><?php echo $std_name?></td>
  </tr>
  <tr>
    <td>Father's Name</td>
    <td><?php echo $std_fname?></td>
  </tr>
  <tr>
    <td>Mother's Name</td>
    <td><?php echo $std_mname?></td>
  </tr>
  <tr>
    <td>Address</td>
    <td colspan="2"><?php echo $std_address?></td>
  </tr>
  <tr>
    <td>Date Of Birth</td>
    <td><?php echo $std_dob?></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>Gender</td>
    <td colspan="2"><?php echo $std_gender?></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td colspan="2"> <strong>Official  Informations</strong></td>
  </tr>
  <tr>
    <td>Technology</td>
    <td colspan="2"><table width="477" border="0">
      <tr>
        <td width="200"><?php echo $id?></td>
        <td width="103">Admission Date:</td>
        <td width="160"><?php echo $id?></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td>Student's Cell No.</td>
    <td colspan="2"><?php echo $id?></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td colspan="2"><strong>Student's Login Info</strong></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td colspan="2"><table width="481" border="0">
      <tr>
        <td width="72">Username:</td>
        <td width="164"><?php echo $id?></td>
        <td width="68">Password:</td>
        <td width="159"><?php echo $id?></td>
      </tr>
    </table></td>
  </tr>
</table>
<br />




<br>
<!-- <input type="submit" name="" value="Back" id="button1" size="10" />  

</form>   
-->


</center>



<!-- image upload test code  --start 2 -->


<!-- image upload test code  --start 2 -->
software_ss is offline   Reply With Quote
Old 20th February 16, 05:22 PM   #2
meesa
WLC Mod
 
meesa's Avatar
 
Join Date: Jul 2009
Location: Milky Way Galaxy
Posts: 3,709
Default Re: Why image not showing (from mysql) database using php? other files are ok.

Are there any errors in your PHP error_log file?
__________________
Praise be to the Lord God for the ability to learn, the capability to analyze, and the time to help users on this forum.
meesa is offline   Reply With Quote
Reply


Thread Tools
Display Modes
Linear Mode Linear Mode

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:42 AM.



Home | Advertise | Contact Us | Top
Home | Advertise | Contact Us | Top

Copyrightę 2006 WeLoveCSS.com. All Rights Reserved.
Powered by vBulletin Version 3.8.4 Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.