How To Open OLE on MS Access using PHP
Posted: Wed Nov 16, 2005 8:05 am
I've created a database on MSAccess. Created a table and included a field for OLE and wanted to display it on the web. Assuming I only have one item on the table...
I get the red X and lots of characters...
I believe there is something wrong with this line...
echo "<img src=$image>";
What do I need on there?
Thanks...
Burrito: Use php tags you should when Posting Code In The Forums you are
Code: Select all
<tr>
<td valign="top">
<?php
$conn=odbc_connect('perfume','','');
if (!$conn)
{exit("Connection Failed: " . $conn);}
$sql="SELECT * FROM Perfume WHERE Sex='M'";
$rs=odbc_exec($conn,$sql);
if (!$rs)
{exit("Error in SQL");}
while (odbc_fetch_row($rs))
{
$prodname=odbc_result($rs,"Product Name");
$brandname=odbc_result($rs,"Brand");
$price=odbc_result($rs,"Price");
$image=odbc_result($rs,"Image");
echo "<img src=$image>";
echo "<div>$prodname for Men by $brandname</div>";
}
odbc_close($conn);
?>
</td>
</tr>I believe there is something wrong with this line...
echo "<img src=$image>";
What do I need on there?
Thanks...
Burrito: Use php tags you should when Posting Code In The Forums you are