duplicate data been displayed
Posted: Wed Jan 21, 2009 3:12 pm
Hi all
I am having a problem where I created a funtion that echos in html, the funtion is called upon multiple times in the html and as a result is displaying the same data. I wanted to know if there is a way around this to display only unique data. Here are the snippets from my code
here is where I have setup the $locate funtion.
and here is the html where I echo the funtion.
I do realizr that I am echoing the same funtion twice and that is probably where I am getting my problem, but is there a way I can do this so that the $locate funtion only pulls back unique sets of data?
Thanks!
I am having a problem where I created a funtion that echos in html, the funtion is called upon multiple times in the html and as a result is displaying the same data. I wanted to know if there is a way around this to display only unique data. Here are the snippets from my code
here is where I have setup the $locate funtion.
Code: Select all
$querydiamond = "SELECT Vendor_Code,Product_Code,Product_Name,Product_Description,Product_Picture,Product_Price,Product_Link FROM merchant WHERE Dmnd = 'x'";
$result = mysql_query($querydiamond) or die ("Error in query: $query. ".mysql_error());
// see if any rows were returned
if (mysql_num_rows($result) > 0) {
echo "<table cellpadding=10 border=1>";
while($row = mysql_fetch_row($result)) {
$locate= $row[4];
and here is the html where I echo the funtion.
Code: Select all
<div class="TabbedPanelsContentGroup">
<div class="TabbedPanelsContent">
<table width="100%" height="100%" border="0" cellpadding="5" align="center">
<tr>
<td><a href="11211011-0124.html"><img src="product_thumbs/<?php echo $locate; ?>" alt="" width="140" height="140" border="0" /></a></td>
<td><a href="11211011-0128.html"><img src="product_thumbs/<?php echo $row[4]; ?>" alt="" width="140" height="140" border="0"/></a></td>
<td><a href="11211011-0130.html"><img src="product_thumbs/11211011-0130.jpg" alt="" width="140" height="140" border="0"/></a></td>I do realizr that I am echoing the same funtion twice and that is probably where I am getting my problem, but is there a way I can do this so that the $locate funtion only pulls back unique sets of data?
Thanks!