Page 1 of 1

php page showing image from mysql db that links to other page

Posted: Mon Aug 21, 2017 9:16 am
by Danny
help. I hope sombody can help me. i have i index.php page showing a db mysql data with images. i need that the images of the index.php liks to another page detail.php. here is the code thath i have, but idon't know how to continue. can anybody help me please????

Code: Select all

<?php
require_once 'dbconfig.php';
?>
<style type="text/css">
<!--
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
-->
</style>
</head>
<body>
<div class="container"><br />
<div class="row">
<?php	
$stmt = $DB_con->prepare('SELECT userID, userLink, userPrice, userAddress, userPic FROM tbl_users ORDER BY userID DESC');
$stmt->execute();

if($stmt->rowCount() > 0)
{
while($row=$stmt->fetch(PDO::FETCH_ASSOC))
{
extract($row);
?>
<div class="col-xs-3">
<p class="page-header">&nbsp;</p>
<?php echo"<a href='detail.php?userId=userID'</a>";?>
<p><img src="user_images/<?php echo $row['userPic']; ?>" class="img-rounded" width="220px" height="180px" />	</p>
<p><span class="page-header"><?php echo $userPrice."&nbsp;/&nbsp;".$userAddress; ?></span></p>
</div> 
<?php
}
}
else
{
?>
<?php
}	
?>
</div>
</div>
</body>
</html>
thanks