ABM2007
01-27-2007, 06:58 PM
Hi guy's, im brand new here so please be gentle.
I have the following issue, i got a database with products, there are 18 collums. for example. search1 which contains a keyword for searching and url-small which contains a picture of the product.
The problem is this:
I have a simple search which will display all items in the database neatly in a table for every hit it gets.
But i want it to look for matching pictures, for example i use url-small to specify which products are the same. so when i have 3 products which look alike they will have the same url-small but a different specification.
So i'd want to get my results like this:
url-small
Product1
product2
product3
instead of:
url-small
Product1
url-small
Product2
url-small
Product3
I hope i'm making sence, excuse me for my language im dutch (A)
and i hope anyone can help me with this. the code i have so far is below:
while($result = @mysql_fetch_array( $data ))
{
echo "<a href=".$result['url-big']."><img src=".$result['url-small']."></a>";
echo $result['Article:'];
echo " ";
echo $result['Ordernumber:'];
echo "<br>";
echo $result['search1'];
echo "<br>";
echo $result['Search3'];
echo "<br>";
}
$anymatches=@mysql_num_rows($data);
if ($anymatches == 0)
{
echo "Sorry, but we can not find an entry to match your query<br><br>";
}
Thanks sincerely,
I have the following issue, i got a database with products, there are 18 collums. for example. search1 which contains a keyword for searching and url-small which contains a picture of the product.
The problem is this:
I have a simple search which will display all items in the database neatly in a table for every hit it gets.
But i want it to look for matching pictures, for example i use url-small to specify which products are the same. so when i have 3 products which look alike they will have the same url-small but a different specification.
So i'd want to get my results like this:
url-small
Product1
product2
product3
instead of:
url-small
Product1
url-small
Product2
url-small
Product3
I hope i'm making sence, excuse me for my language im dutch (A)
and i hope anyone can help me with this. the code i have so far is below:
while($result = @mysql_fetch_array( $data ))
{
echo "<a href=".$result['url-big']."><img src=".$result['url-small']."></a>";
echo $result['Article:'];
echo " ";
echo $result['Ordernumber:'];
echo "<br>";
echo $result['search1'];
echo "<br>";
echo $result['Search3'];
echo "<br>";
}
$anymatches=@mysql_num_rows($data);
if ($anymatches == 0)
{
echo "Sorry, but we can not find an entry to match your query<br><br>";
}
Thanks sincerely,