37 users online (1 members and 36 guests)  


Page 2 of 2 First 1 2
  Results 16 to 25 of 25

Related

  1. Replies: 1
  2. need help displaying results with links    Forum: PHP Forum
    Replies: 0
  3. Replies: 4
  4. Displaying Paged Results In A Table    Forum: Javascript Forum
    Replies: 4
  5. google search results    Forum: HTML Forum
    Replies: 1
  1. #16
    rdub's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2006
    Posts
    15

    Re: displaying search results

    How would you like to see it?

  2. #17
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: displaying search results

    do you have a thing called phpmyadmin in your control panne?

    if not you can alwasys download it from:

    http://www.phpmyadmin.net

    then export it save it then let us see it (make sure you only export that one table! not the entire database because you dont want things like passwords to get out)

  3. #18
    rdub's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2006
    Posts
    15

    Re: displaying search results

    Will this work?

    "1";"A Cut Above";"Karen";"Johnston";"951-659-5062";;;"P.O. Box 3635";;"Idyllwild";"CA";"92549";;;"Health & Fitness";"Beauty";
    "2";"Adele Smith";"Adele";"Smith";"909-659-8725";;;"P.O. Box 3203";;"Idyllwild";"CA";"92549";"roadsmith11925@greencafe.com";;"Individual Member";;
    "3";"Alderwood Cabin Rentals";"Joan";"Zerrien";"951-659-3571";;;"P.O. Box 849";;"Idyllwild";"CA";"92549";"info@alderwoodcabins.com";"www.alderwoodcabins.com";"Places to Stay";"Lodging Facilities";"unique vintage cabins in tranquil natural setting, easy walk to village center."
    "4";"Allan Morphett";"Allan";"Morphett";"951-659-2235";"951-642-3310";"951-659-8236";"PO Box 337";;"Idyllwild";"CA";"92549-0337";"amophett@aol.com";;;;
    "5";"American Legion Post 800";"Ed";"Anderson";"951-659-3517";;"951-659-0538";"POB 800";;"Idyllwild";"CA";"92549";"post800@pe.net";;"Service Clubs";"Service Clubs/Organizations";
    "6";"Archer's Home Maintenance & Repair";"William";"Archer";"951-659-5041";"951-294-0403";;"P.O. Box 3478";;"Idyllwild";"CA";"92549";"gwedion2003@yahoo.com";;"Home & Automotive";"Home Improvement";"Home maintenance and repair, painting, light plumbing and electrical."
    "7";"ARF";"Jane";"Stonehill";"951 659-1122";;;"P.O. Box 1965";"54425 North Circle Dr.";"Idyllwild";"CA";"92549";"arf@greencafe.com";"www.idyllwildarf.org";"Animal Rescue";"Pet Services & Supply";"Volunteer, non-profit organization for the mountain communities. Rescues lost & abandoned pets."
    "8";"Art Alliance of Idyllwild";"Bill";"Sperling";"866-439-5278";;;"POB 243";;"Idyllwild";"CA";"92549";;;"Art/Music";"Galleries";
    "9";"Atipahato Lodge";"Sheila";"Weldon";"951-659-2201";;"951-659-9822";"66 Calle Manzanita";;"Rancho Mirage";"CA";"92279";"info@atipahatolodge.com";;"Places to Stay";"Lodging Facilities";
    "10";"Baker Galleries";"Kristy & George";"Baker";"951-659-2597";"951-733-4670";;"PO Box 1122";"54425 North Circle Dr.";"Idyllwild";"CA";"92549";"bakergalleries@hotmail.com";"www.bakergalleries.com";"Art/Music";"Galleries";"Showcase 75+ local and int'l artists.Wood turnings,bronze sculptures,paintings,jewelry,ceramics,etc"
    "11";"Better Wildlife Control";"Tracy";"Phillippi";"951-659-0525";"951-795-6093";;"P. O. Box 234";;"Idyllwild";"CA";"92549";"animalguy4u@hotmail.com";"www.betterwildlifecontrol.org";"Contractors";"Contractors";"We handle problems with wildlife and pests. Fully licensed, insured and bonded."
    "12";"Blue Bird Cottage Inn";"Jennifer";"Anderson";"951-659-2696";;"951-659-8753";"P.O. Box 963";"26905 Highway 243";"Idyllwild";"CA";"92549";"bluebirdcottage@verizon.net";"www.thebluebirdcottageinn.com";"Places to Stay";"Lodging Facilities";
    "13";"Buy Plans Now";;;"951-659-4387";;"951-659-4380";"P.O. Box 1427";;"Idyllwild";"CA";"92549";"buyplansnow@yahoo.com";;;;
    "14";"Cafe Aroma";"Hubert";"Halkin";"951-659-5212";;;"P.O. Box 1295";"54750 North Circle Dr.";"Idyllwild";"CA";"92549";"hubert@cafearoma.org";"www.cafearoma.org";"Places to Eat";"Full Service Restaurants";
    "15";"Cafe Rendezvous";"Jim or Amanda";"Moropoulos";"951-659-5205";;;"P. O. Box 1560";"26290 Highway 243";"Idyllwild";"CA";"92549";;;"Places to eat";"Full Service Restaurants";"Continental cuisine, excellent food at reasonable prices. Fine wines, fine beers & fine service!"
    "16";"Caine Learning Institute";"Geoffrey";"Caine";"951-659-0152";;;"P.O. Box 1847";;"Idyllwild";"CA";"92549";"geoffrey@cainelearning.com";"www.cainelearning.com";"Education";"Schools";"Learning and education consultants, speakers and writers."
    "17";"Candy Cupboard";"Patty";"McKee";"951-659-5502";;;"P.O. Box 794";"54250 North Circle Dr.";"Idyllwild";"CA";"92549";"patty@candycupboard.com";;"Places to Eat";"Coffee House/Snacks/Treats";
    "18";"Cedar Street Inn";"Richard";"Cardieux";"951-659-4789";;"951-659-1049";"P.O. Box 627";"25870 Cedar Street";"Idyllwild";"CA";"92549";"inn@cedarstreetinn.com";"www.cedarstreetinn.com";"Places to Stay";"Lodging Facilities";
    "19";"Charles Wix";"Charles";"Wix";"951-659-4957";;;"POB 3613";;"Idyllwild";"CA";"92549";"idylwix@greencafe.com";;;;
    "20";"Christmas Is Idyllwild";"Ron";"Bianchi";"951-659-0021";;;"P.O. Box 1780";;"Idyllwild";"CA";"92549";"christmasisidyll@aol.com";;"Places to Shop";"Specialty Shops";"Largest Christmas Gift and Holiday store with year round souvenirs & fine gifts."
    "21";"Community";"Elizabeth";"Todd";"951-659-4748";;"951-659-4746";"P.O. Box 1346";;"Idyllwild";"CA";"92549";"ets@elizabethtodddesigns.com";;"Places to Shop";"Specialty Shops";"Creative and artistic gift store and boutique."
    "22";"Corniche Travel";"Dorian";"Paul";"951-659-2568";;"951-659-2569";"P.O. Box 1399";;"Idyllwild";"CA";"92549";"dorian@corniche.com";;"Professional Services";"Travel";"Full service travel agency."
    "23";"Coulter Pines Home Owners Association";"Ruth & Bob";"Gano";"951-659-2593";;;"P.O. Box 2035";;"Idyllwild";"CA";"92549";"idyltour@webtv.com";;"Service Clubs";"Organizations";
    "24";"Creek House";"Jane";"Wagstaff";"951-659-0686";;;"P.O. Box 1680";"54905 North Circle Dr.";"Idyllwild";"CA";"92549";"lanny@greeencafe.com";"www.idyllwildweddings.com";"Restaurant";;"Restaurant, Wedding site."
    "25";"Cut & Dry Construction";;;;"951-265-7322";;"P.O. Box 3748";;"Idyllwild";"CA";"92549";"slvrmoonshine07@aol.com";;"Contractors";"General";"Handyman: drywall, cabinet, shelving, rebuild kitchen."
    "26";"CWI, Inc.";"Carolyn";"Thomas";"951-659-9659";"909-815-9691";"951-659-2213";"P. O. Box 29";;"Mountain Center";"CA";"92561";"cwiinc@verizon.net";"www.cwicustomhomes.com";"Contractors";"General";"Custom home construction, remodels, woodwork."

  4. #19
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: displaying search results

    well i am a bit lost... well not lost... but more like... confused...

    if i understand correctly, this database was configued wrong for what you want...

    if i understand what you want correctly... you should have made 2 tables... 1 for categories another for items that go in those categories.

    so...

    it should look more like this:

    select * from categorytable order by asc

    and the other sql should look more like this:

    select * from memberslist where category = $categoryid

    and of corse the $caegoryid would be the id of the category

    it is doing exactly what it supposed too you are just not doing it right...

    then in the "categories" row in the table should be the id of the coresponding item... and if you wanted to go more advacned you could do:

    SELECT * FROM memberslist (LEFT JOIN * ON categoriestable WHERE categoryid=$categoryid) WHERE category = $categoryid ORDER BY ASC

    but i wouldnt go that far,
    -ALL

  5. #20
    rdub's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2006
    Posts
    15

    Re: displaying search results

    Two table? Should it be able to query from the search criteria and display all info based on that search within the same table?

  6. #21
    rdub's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2006
    Posts
    15

    Re: displaying search results

    For instance, I want to be able to select "places to stay" as my search criteria and display info about all inns and lodges that have "places to stay" as their category.

  7. #22
    ALL's Avatar
    Super Dooper Nerd

    Status
    Offline
    Join Date
    Feb 2005
    Location
    localhost
    Posts
    382

    Re: displaying search results

    yes, actually you can do it better this way. just run 2 queries one to find out what the categories are and another to find out what the items are.

  8. #23
    DeadMeatGF's Avatar
    Moderator

    Status
    Offline
    Join Date
    Sep 2005
    Posts
    381

    Re: displaying search results

    `id` is your first column, right?
    What you're doing is querying on the id, which is a unique value, so you'll only ever get one result.
    You need to query on "category=$select" instead, then loop through the results as described above.

  9. #24
    rdub's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2006
    Posts
    15

    Re: displaying search results

    When I make the change "category=$select" I get the error
    Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/idyllwil/public_html/test_back_members.php on line 45

  10. #25
    rdub's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2006
    Posts
    15

    Re: displaying search results

    I've changed where I thought it was required but it doesn't work.
    <?
    // Connect database
    mysql_connect("login","info","removed");
    mysql_select_db("idyllwil_members");
    // If submitted, check the value of "select". If its not blank value, get the value and put it into $select.
    if(isset($select)&&$select!=""){
    $select=$_GET['select'];
    }
    ?>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    </head>
    <body>
    <form ID="form1" Category_Listing"form1" method="get" action="<? echo $PHP_SELF; ?> ">
    Selections :
    <select name="select">
    <option value="">--- Select ---</option>
    <?
    // Get records from database (table "member_list").
    $list=mysql_query("select * from member_list order by id asc");
    // Show records by while loop.
    while($row_list=mysql_fetch_assoc($list)){
    ?>
    <option value="<? echo $row_list['ID']; ?>"
    <? if($row_list['ID']==$select){ echo "selected"; } ?>>
    <? echo $row_list['Category_Listing']; ?></option>
    <?
    // End while loop.
    }
    ?>
    </select>
    <input type="submit" name="Submit" value="Select" />
    </form>
    <hr>
    <p>
    <?
    // If you have selected from list box.
    if(isset($select)&&$select!=""){
    // Get records from database (table "member_list").
    $result=mysql_query("select * from member_list where Category_Listing='$select'");
    while($row=mysql_fetch_assoc($result)) {

    ?>

    Information about <strong><? echo $row['Customer']; ?></strong> company...</p>
    <?
    // End While statement
    }
    // End if statement.
    }

    // Close database connection.
    mysql_close();
    ?>
    </p>
    </body>
    </html>
    Last edited by rdub; 11-06-2006 at 11:18 PM. Reason: login info removed



Page 2 of 2 First 1 2

Tags for this Thread