lse123
11-25-2007, 06:09 PM
Can you tell me how to get values [eg. $photo=image3, $details=link3] from database table to build an image and a link ? below html/mysql syntax is correct ?
<? ... db connection & query from result I get...
$photo = mysql_result($result,$i,"photo");
$details = mysql_result($result,$i,"details");
...?>
[$photo=image1]
<img src="/images/search/.htmlentities($photo)..jpg" alt="h" width="200" height="132" />
or
[$photo="/images/search/image1.jpg"]
<img src="<?= $photo ?>" alt="h" width="200" height="132" />
is it correct to save urls in mysql tables or php vars ?
same implies to below ?
<a href="/apartments/akamasvillageargaka.php<?= $details ?>">
<? ... db connection & query from result I get...
$photo = mysql_result($result,$i,"photo");
$details = mysql_result($result,$i,"details");
...?>
[$photo=image1]
<img src="/images/search/.htmlentities($photo)..jpg" alt="h" width="200" height="132" />
or
[$photo="/images/search/image1.jpg"]
<img src="<?= $photo ?>" alt="h" width="200" height="132" />
is it correct to save urls in mysql tables or php vars ?
same implies to below ?
<a href="/apartments/akamasvillageargaka.php<?= $details ?>">