Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    SQL&PHP Search table merge.

    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:

    Code:
    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,

  • #2
    New to the CF scene
    Join Date
    Jan 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Do i have bad breath or something?

  • #3
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,631
    Thanks
    4
    Thanked 147 Times in 138 Posts
    no, you haven't waited any amount of time at all. This isn't a live chat forum, please don't bump your own posts after only two hours. People may not have had a chance to respond because they have not seen your post. Others may not know how to answer your post.

    Read the albums/artists link in my signature. It will give you an idea you can adapt to do what you need. PHP code included.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •