hello, i am writing a php file called books.php which queries a table named ‘products’ from a database and displays the book information it contains. In addition, to other fields, each book in the products table in the IC2A2_07.mdb (name of the database) database has a field called coverart the value of which refers to the jpg file name which is the book cover image of the respective book. I have created a folder to store the cover images of all books to reduce server burden.
however, i am having trouble with the php coding to display the pictures of the books. does anyone know how to go about displaying them? i plan to do them under the ‘coverart’ variable. This is as far as ive gotten.
[code=php]<?php
$conn=odbc_connect(‘IC2A2_07’,”,”);
if (!$conn) {
exit(“Connection Failed: ” . $conn);
}
$sql=”SELECT * FROM products”;
$rs=odbc_exec($conn,$sql);
if (!$rs) {
exit(“Error in SQL”);
}
// table creation
print “<table><tr>”;
print “<th>ID</th>”;
print “<th>title</th>”;
print “<th>authors</th>”;
print “<th>Date</th>”;
print “<th>edition</th>”;
print “<th>isbn</th>”;
print “<th>coverart</th>”;
print “<th>price</th>”;
print “<th>select</th></tr>”;
while (odbc_fetch_row($rs)) {
$ID=odbc_result($rs,”ID”);
$title=odbc_result($rs,”title”);
$authors=odbc_result($rs,”authors”);
$Date=odbc_result($rs,”publishDate”);
$edition=odbc_result($rs,”edition”);
$isbn=odbc_result($rs,”isbn”);
$coverart=odbc_result($rs,”coverart”);
$price=odbc_result($rs,”price”);
print “<tr><td>$ID</td>”;
print “<td>$title</td>”;
print “<td>$authors</td>”;
print “<td>$Date</td>”;
print “<td>$edition</td>”;
print “<td>$isbn</td>”;
print “<td>$coverart</td>”;
print “<td>$price</td>”;
print “<td>$select</td></tr>”;
}
odbc_close($conn);
echo “</table>”;
?>
any help would be much appreciated, thanks (: