Jump to content

problem display image from mysql blob field?


freaker87

Recommended Posts

this is my 3 files which is i am using to show data of customer

but i am not able to see them their logo image plz see them & help me guys

 

i dont know whats wrong in this.

 

these files i uploaded plz find attachment to see them.

 

thnx in advanced

 

[attachment deleted by admin]

these are codes of my files cystlook.php

 

<?php require_once('includes/header.php'); ?>
<script language="JavaScript" src="js/gen_validatorv4.js" type="text/javascript" xml:space="preserve"></script> 
<?php require_once('includes/nav.php'); ?> 
<div id="content">
        <h3 align="center"> Modify Customer </h3>
    <div id="box-form">
        
    	<form name="custlook" method="post" action="custmod.php">
            <div>
                <lable>Select Customer</label>
            
                
                <?php
                
                include('includes/connect.php');
                
                $Tb = "custmaster";
                
                mysql_select_db($Db, $link);
                
                $query = "select custid,custname from $Tb order by custid";
                
                $result= mysql_query($query,$link);
                
                $fel=mysql_num_fields($result);
                $nro=mysql_num_rows($result);
                
                if ($nro>0)
                
                {
                
                    echo "<select name='custid'>\n";
                
                    echo "<option>-- Select Customer Name --</option>\n";
                
                    while ($row=mysql_fetch_array($result))
                
                    {
                
                            echo "<option value='$row[custid]''>$row[custname]</option>\n";
                                        
                    }
                    
                    echo "</select>";
                
                }
                
                mysql_close($link);
                
                ?>                            
            </div>
            
            <div>
            	<input type="submit" value="Save" class="button" /> 
            </div>
            <div align="center">
              <a href="view/custlistview.php" target="_blank">See All Product List</a>
            </div>
</form>
    
    
    
</div>

</div>

<script language="JavaScript" type="text/javascript">

var frmvalidator = new Validator("custlook");

frmvalidator.addValidation("custid","dontselect=0","Please select custmore!"); 
      
</script>

<?php require_once('includes/footer.php'); ?>        


 

 

 

 

 

this is custmod.php

 

<?php
                                                              

$custval=$_POST['custid'];

include('includes/connect.php');

mysql_select_db($Db, $link);

$query = "select * from custmaster where custid='$custval'";

$result= mysql_query($query,$link);

$fel=mysql_num_fields($result);

$nro=mysql_num_rows($result);

if($nro<=0)
{
	include 'custlook.php';
	echo "<script type='text/javascript'> window.alert('Please Select Valid Customer')</script>";
	exit();
}

$row=mysql_fetch_array($result);

$custname = $row['custname'];
$custadd = $row['custadd'];
$custphn = $row['custphone'];
$custmail = $row['custemail'];
$custweb = $row['custwebsite'];
$custsys = $row['custsys'];

?>
<?php require_once('includes/header.php'); ?>
<script language="JavaScript" src="js/gen_validatorv4.js" type="text/javascript" xml:space="preserve"></script> 
<?php require_once('includes/nav.php'); ?> 
<div id="content">
    <h3 align="center"> Modify Customer </h3>
    <div id="box-form">
  	<form name="custmod" method="post" action="custupdate.php" enctype="multipart/form-data">
        
        <!--hidden description of product -->
            <div>
                <input name="txtcustid" type="hidden" size="50" maxlength="100" value="<?php echo $custval;?>" />
                <input name="txtcustnam" type="hidden" size="50" maxlength="100" value="<?php echo $custname;?>" />           
                <label>Customer Name <strong>*</strong></label>
    		    <input name="txtcustname" type="text" size="50" maxlength="100" value="<?php echo $custname;?>" />
      	    </div>
        
  		    <div>
    		    <label>Customer Address </label>
    		    <textarea name="txtcustadd" rows=5 cols=40 size="200" maxlength="200"><?php echo $custadd;?></textarea>
  		    </div>
            
            <div>
                <label>Customer Phone</label>
                <input name="txtcustphn" type="text" id="txtcustphn" size="50" maxlength="20" value="<?php echo $custphn;?>" />
            </div>
            
            <div>
                <label>Customer Email</label>
                <input name="txtcustmail" type="text" id="txtcustmail" size="50" maxlength="50" value="<?php echo $custmail;?>" />
            </div>
            
            <div>
                <label>Customer Website</label>
                <input name="txtcustweb" type="text" id="txtcustweb" size="50" maxlength="50" value="<?php echo $custweb;?>"/>
            </div>
            
            <div>
                <label>Customer System Id <strong>*</strong></label>
                <input name="txtcustsys" type="text" id="txtcustsys" size="50" maxlength="25" value="<?php echo $custsys;?>" />
            </div>
            
            <div>
                <label>Customer Logo </label>
                <input name="txtcustlogo" type="file" id="txtcustlogo" />
            </div>
            
            <?php
            include "custlogodis.php";
            echo $row['custlogo'];
            ?>
            
        <div>
    		<input class="button" name="cmdsubmit" type="submit" id="cmdsubmit" value="Save" <?php echo $disabled; ?> />
  		</div>
        
    </form>
    </div>
</div>

       <script language="JavaScript" type="text/javascript" xml:space="preserve">
         var frmvalidator  = new Validator("custmod");
         frmvalidator.EnableMsgsTogether();
            
            frmvalidator.addValidation("txtcustname","req","Enter Customer Name!");
            frmvalidator.addValidation("txtcustadd","req","Enter Customer Address!");
            frmvalidator.addValidation("txtcustsys","req","Enter Customer System Id!");
            frmvalidator.addValidation("txtcustmail","email","Enter valid Email!");
            frmvalidator.addValidation("txtcustphn","num","Enter valid Phone No.!");
            frmvalidator.addValidation("txtcustadd","maxlen=250","Address Not More Than 250 Character!");
            frmvalidator.addValidation("txtcustlogo","file_extn=jpg;jpeg;gif;png","Allowed files types are: jpg,gif,png");
       </script>   


</body>
</html>

 

 

this is custlogodis.php

<?php

$custval=$_POST['custid'];

include('includes/connect.php');

mysql_select_db($Db, $link);

$query = "select * from custlogo where custid='$custval'";

    $result= mysql_query($query,$link);

    $nro=mysql_num_rows($result);
    
    $row = mysql_fetch_array($result);
    

            if($nro<=0)
                {
                    $custlogo = "No Logo Uploaded";
                }                         
             else
             
                {
                 
                   $custlogo = $row['custlogo'];
                 
                }
    
?>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.