Output Images from Database - Problem - help
Posted: Mon Feb 02, 2009 2:47 am
I saved my image path to a database and tried to retrieve the actual images using the code below.
<?php
$db = odbc_connect("asaa","asaa_user","asas");
$sql = "SELECT id, url, time FROM fotogalerie";
$res = odbc_exec($db, $sql);
while ($row = odbc_fetch_array($res)) {
print($row['id'].",".$row['url'].",".$row['time']."\n");
}
odbc_free_result($res);
odbc_close($db);
?>
Instead of getting the images that I need I get the output below:
101,/gg/en/pple/007_old/image1.jpg, 102,/gg/en/pple/007_old/image1.jpg,
101,/gg/en/pple/007_old/image2.jpg, 102,/gg/en/pple/007_old/image2.jpg,
101,/gg/en/pple/007_old/image3.jpg, 102,/gg/en/pple/007_old/image3.jpg,
where am I going wrong? Thank for your help.
<?php
$db = odbc_connect("asaa","asaa_user","asas");
$sql = "SELECT id, url, time FROM fotogalerie";
$res = odbc_exec($db, $sql);
while ($row = odbc_fetch_array($res)) {
print($row['id'].",".$row['url'].",".$row['time']."\n");
}
odbc_free_result($res);
odbc_close($db);
?>
Instead of getting the images that I need I get the output below:
101,/gg/en/pple/007_old/image1.jpg, 102,/gg/en/pple/007_old/image1.jpg,
101,/gg/en/pple/007_old/image2.jpg, 102,/gg/en/pple/007_old/image2.jpg,
101,/gg/en/pple/007_old/image3.jpg, 102,/gg/en/pple/007_old/image3.jpg,
where am I going wrong? Thank for your help.