Image will not display when pulling from mysql

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sifedirector
Forum Newbie
Posts: 1
Joined: Thu Jul 21, 2011 11:10 am

Image will not display when pulling from mysql

Post by sifedirector »

Here is my code, I cannot get the image to display, everything else is working.

Code: Select all

[syntax=php]<?php
require_once("models/vendors.php");
$vendor = new Vendors();

$vend = $vendor->getByVendorId($_GET['id']);
?>

<?php 
	$vendor->UpdateViewsCount

($total_views,$_GET['id']);
?>
<table width="400" align="center">
	<tr>
    	<td colspan="2">
   
<img src="vend['image']"/>    // HERE IS WHAT IS NOT WORKING, I HAVE TRIED SEVERAL Iterations

   <tr>
    	<td>
        	<table border="0" width="400" cellpadding="0" cellspacing="0">
                <tr>
              	<td style="padding: 5px;" valign="top">
                    	
<td style="padding: 5px">              	
              
<b>For more information about <?=$vend['company']?></b><br />

<a href="<?=$vend['website']?>" target="_blank"><?=$vend['website']?></a>
 <br /><br /> 
<b>Contact:</b> <br />  
                    
	 <?=$vend['first_name']?> <?=$vend['last_name']?><br />

	 <?=$vend['Address_1']?><br />

	 <?=$vend['Address_2']?><br />

Phone: <?=$vend['mobile_phone']?><br />
                      
Email: <a href="mailto:<?=$vend['email']?>"><?=$vend['email']?></a>
 

                   </td>
                </tr>
            </table>
        </td>
    </tr>
</table>
<?php /*}

<?php }*/ ?>
[/syntax]
User avatar
social_experiment
DevNet Master
Posts: 2793
Joined: Sun Feb 15, 2009 11:08 am
Location: .za

Re: Image will not display when pulling from mysql

Post by social_experiment »

viewtopic.php?f=1&t=110171&p=582727#p582727
This url could be of some help
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
Post Reply