Results 1 to 5 of 5

Thread: Looking for beginer help creating a table

  1. #1
    Join Date
    Dec 2007
    Posts
    31
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Looking for beginer help creating a table

    I have been asking really basic generic questions trying to find out what I need to start building a search function for my web site and as far as I know the first step is for me to conceive the database organization. I thought this sounded easy, because I just needed to make a table but that thought didnt last long.

    I don't know any php or mysql code. I just searched around and found that phpmyadmin was a really good program and I check my cpanel to make sure I had it.

    Then I looked into the database and I found out that I need a table but the page i was reading was kinda like my question very vague and didn't give me any step by step instructions.

    So right now I am trying to conceive the database organization. I thought this sounded easy, because I just needed to make a table but that thought didnt last long.

    Where do I make the table at on a blank page? On my index? on my search page? It didnt say

    I think I need one entry per species, with at least one field being an absolutely unique ID: usually just a number or something. It would be tempting to use the Latin name, since a species is uniquely identified by its name, but this is probably not a good idea, because of subspecies, and curiosities like the "official name" changing.

    but I don't know if I need to do that because I want something that will allow my users to submit all the data. Its hard to explain but there are 800+ different species and there are news found all the time. If I need to make a table with all of them in it then doing it this way is not what I neeed.

    I'm sure I'm going to have to code my own but if there are many choices to code it with what option would you guys recommend for someone that only knows html/css?

    I am willing to lean new code though i just heard that you could it without php or mysql.

    Thanks so much for all the advice I'm just having trouble finding a starting place.

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    it can be done without a server-side language and/or database, but it would require alot more work for you.

    in most control panel's there is a button to create a database. after you have created the database you should be able to go into phpMyAdmin and from there you should be able to start your first table. There should be a button to create a new table, and there will be inputs to the number of fields you would like in that table.

    I would suggest that you first plan out your database schema before you create the tables and references. There are many ways to create a database and its schema however to me I always like to write down every field I would like to capture, then find the similarities or "groups" that could potentially be shared among the records... for instance a family of animals. mammals / fish / birds... those are distinct families that can be helpful in searching, thus I would create a table for "animal type" and put some generic information about each type.

    I then start to break down my 1 table into the multiple using those additional fields. until i am left with a "couple" of what I would call content tables (meaning that these are the primary information housing storage units) and a number of "reference" tables that contain those miscellaneous data points like species group or family type etc...

    I am sure all of that went over your head so below is hopefully a better demonstration of what i mean


    Code:
    animal { 
         animal_id
         name
         latin
         type
         eating_habit
    }
    
    type {
         type_id
         title
         description
    }
    
    eating_habits {
          eh_id
          title
          description
    }
    data
    Code:
    animal {
        1    'dolphin'    'latin-dolphin'    1     1
        2    'eagle'      'latin-eagle'      2     2
        3    'human     'latin-human'     1     3
        4    'shark'      'latin-shark'       3     1
    }
    
    type {
        1    'mammal'    'this is a mammal group of species'
        2    'bird'          'these animals have wings'
        3    'fish           'these animals live in water and have gills'
    }
    
    eating_habits {
        1    'omnivore'    'eat vegetation and meat'
        2    'carnivore'    'primarily eat meat'
        3    'herbivore'    'primarily eat vegetation'
    }
    the primary table is the "animals" it has a reference to all of the groups that are shared... so no one needs to write out "omnivore" in every record or no need to write out "mammal" or "bird" you just have a unique reference number that points to a field, and that field can be linked and have data brought when that time comes.

  3. #3
    Join Date
    Dec 2007
    Posts
    31
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    http://www.tarantuladatabase.com/assets/pages/test.html

    This is kinda what I have been playing around with for php If this is working I can see how it works a little.

    I haven't been able to get connected to the database I did find phpmyadmin. I made a table with 1 feild but I don't understand what format I need to use.

    Will i have 1 table for each spider or will i have 1 table called Tarantula with 1 field called Housing and so one like this.

    Code:
    Table called Tarantula
    
    >Housing
    >>>>>>>>Arboreal
    >>>>>>>>Terrestrial
    >>>>>>>>Fossorial
    >Location
    >>>>>>>>New World
    >>>>>>>>Old World
    >Speed
    >>>>>>>>Slow
    >>>>>>>>Medium
    >>>>>>>>Fast
    Is this right at all?
    I am confused about the things that I dont know like genes species and color.

  4. #4
    Join Date
    Dec 2007
    Posts
    31
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I think i got the hang of how to create the table... I think

    This is my table

    http://www.tarantuladatabase.com/table.JPG

    and these are the values

    http://www.tarantuladatabase.com/value.JPG

    I couldn't figure out how to leave a field value black so I just put None in as a place holder.

    How does that look?

  5. #5
    Join Date
    Dec 2007
    Posts
    31
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    never mind I fixed the id thing and got rid of the search all and none values.

    http://www.tarantuladatabase.com/gotit.JPG

    now i guess i'll try and connect it to the database *Gulp*

    unless you guys have any advice?

Bookmarks

Posting Permissions

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