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 8 of 8
  1. #1
    New Coder
    Join Date
    Feb 2013
    Location
    Chaska, Minnesota
    Posts
    18
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Search Program and Other Stuff

    For my historic bridge website, I would like to create a search program which searches a predetermined database (.csv file) for a variety of things and will display the bridges (and small pictures of the matching bridge) that match the criteria on another page, linking back to the pages for the bridges. In addition, I would like to have pages for certain categories such as builder where I would describe it, and a program of sorts would pull out of the same database and generate a list of random bridges that are in that catagory (including pictures).

    My questions are: What program would work for this (I am assuming perl) which I could create a search program to search with an "and" search and would be capable of searching through many different categories?

    How would I add pictures to be displayed on the results and random page?

    Creating the search criteria page, I would prefer drop boxes. How could I do this?

    How would I hook up the second part (extra pages) to have displayed a random series of bridges from the .csv file? Would this take an additional script?

    Any help would be greatly appreciated! I just need to know what my options are, no codes right now. I will work on that at a later date.
    -John Marvig

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,081
    Thanks
    23
    Thanked 592 Times in 591 Posts
    This is MHO: Don't use .csv files, use a database there are 600,000 bridges in the USA. DBs are better suited to this task. MySQL would be my choice because it is everywhere.

    Perl is good if you already know it. PHP is also a good choice for server side communication with the DB.

    For images you could place them in the DB or in a folder and place a link to the image in the DB. Your choice.

    Dropdowns for the search criteria is fine and right now I'd go about making up the HTML page that would be used for them. That would help with the criteria needed to set up your DB.

    The "display a random series of bridges" part of your question I'd leave alone until you get this up and running.
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."

  • #3
    New Coder
    Join Date
    Feb 2013
    Location
    Chaska, Minnesota
    Posts
    18
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by sunfighter View Post
    This is MHO: Don't use .csv files, use a database there are 600,000 bridges in the USA. DBs are better suited to this task. MySQL would be my choice because it is everywhere.

    Perl is good if you already know it. PHP is also a good choice for server side communication with the DB.

    For images you could place them in the DB or in a folder and place a link to the image in the DB. Your choice.

    Dropdowns for the search criteria is fine and right now I'd go about making up the HTML page that would be used for them. That would help with the criteria needed to set up your DB.

    The "display a random series of bridges" part of your question I'd leave alone until you get this up and running.
    Would a database be easier to create a script for? I already have a csv file ready, and it will only contain 1000-2000 bridges for the time being (next 10 years at least). I am not real familiar with MySQL, so it would have to be something new that I learn. I'm looking for not only efficiency but what is easiest to do as well.
    -John Marvig

  • #4
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,081
    Thanks
    23
    Thanked 592 Times in 591 Posts
    Try it first with csv file and see if it's slow, if not go with it, we can always change it to DB later. I think the big thing is to get started and code the dropdowns.
    With a csv file I think you want the images in a folder and the name of the image in your cvs.
    Good Luck and if you have problems we're always here
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."

  • #5
    New Coder
    Join Date
    Feb 2013
    Location
    Chaska, Minnesota
    Posts
    18
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by sunfighter View Post
    Try it first with csv file and see if it's slow, if not go with it, we can always change it to DB later. I think the big thing is to get started and code the dropdowns.
    With a csv file I think you want the images in a folder and the name of the image in your cvs.
    Good Luck and if you have problems we're always here

    How would I put the image links into the .csv file?
    -John Marvig

  • #6
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,081
    Thanks
    23
    Thanked 592 Times in 591 Posts
    Just like having a folder for images or css or javascript, I'd have one called "bridges" that held all my photos. In there I have the "Hell_Gate_Bridge" [Please note I use underscores and not spaces. Spaces cause a lot of problems so I never use them anywhere.]
    I don't know how your planning on going to match the criteria to the cvs file line, but lets say your line looks like this:
    railroad, new_york, active, water, prr, Hell_Gate_Bridge.jpg, some info about the bridge

    The prr is for Pennsylvania Railroad. When you get this line you know the image can be called using bridges/Hell_Gate_Bridge.jpg
    In HTML talk:
    <img src="bridges/Hell_Gate_Bridge.jpg" alt="The hell gate bridge" />

    FYI you could have a link to the info your going to show about the bridge so that it's separate from the cvs
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."

  • #7
    New Coder
    Join Date
    Feb 2013
    Location
    Chaska, Minnesota
    Posts
    18
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by sunfighter View Post
    Just like having a folder for images or css or javascript, I'd have one called "bridges" that held all my photos. In there I have the "Hell_Gate_Bridge" [Please note I use underscores and not spaces. Spaces cause a lot of problems so I never use them anywhere.]
    I don't know how your planning on going to match the criteria to the cvs file line, but lets say your line looks like this:
    railroad, new_york, active, water, prr, Hell_Gate_Bridge.jpg, some info about the bridge

    The prr is for Pennsylvania Railroad. When you get this line you know the image can be called using bridges/Hell_Gate_Bridge.jpg
    In HTML talk:
    <img src="bridges/Hell_Gate_Bridge.jpg" alt="The hell gate bridge" />

    FYI you could have a link to the info your going to show about the bridge so that it's separate from the cvs
    Alright this is what I have figured out how to put in to the csv file. Create a file of small icon photos, and link those into the file. Then program it to display when a search comes up.
    -John Marvig

  • #8
    New to the CF scene
    Join Date
    Sep 2013
    Location
    USA
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    How would I add pictures to be displayed on the results and random page, and image link


  •  

    Posting Permissions

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