Skip navigation
Currently Being Moderated

Build a basic results page

May 3, 2012 8:22 AM

 
Replies
  • Currently Being Moderated
    May 3, 2012 8:22 AM   in reply to Community Help

    I want to have a search field that the customer puts an item code in that will then lead them to an item that cannot be accessed otherwise.  I am new to Dreamweaver so I am a bit confused as to what would be the simplest way to complete this.  Then, on the Spry Slideshow widget how can you get your own pics into it?

     
    |
    Mark as:
  • Sudarshan Thiagarajan
    4,000 posts
    Oct 15, 2010
    Currently Being Moderated
    May 3, 2012 9:53 AM   in reply to Laurian Halverson

    For Spry Slideshow Widget, this should help you: http://labs.adobe.com/technologies/spry/ui/docs/image_slideshow.htm

     

    For the item code thing, its a simple PHP search function where your script will execute a 'SELECT' MySQL query to figure out if the entered product code matches anything in your DB and it returns that item as a result. It'll be something like this. Your file should be saved as .php. Change 'localhost, username, password, dbname', according to your current setup. product_name is a column in your DB. Also, I'd highly recommend a set of books that's specifically written to cater to needs of people like you. I suggest you take a look at it. http://www.sitepoint.com/books/phpmysql5/

     

    Here's the code.

     

    mysql_connect('localhost', 'username', 'password');
    mysql_select_db
    ('dbname');

    $sql = "SELECT * FROM table WHERE product_name LIKE '%" . mysql_real_escape_string($_GET['search_query']) . "%'";

    $result = mysql_query($sql) or die("Error in query $sql: " . mysql_error());
    while ($row = mysql_fetch_array($result)) {
        echo
    "Product: " . $row['product_name'] . "<br />";
    }

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points