Jump to content

Maracles

Members
  • Posts

    87
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Maracles's Achievements

Member

Member (2/5)

0

Reputation

  1. Thanks a lot, I think I get what you mean and it definitely seems simpler. I have not used enum previously but have just looked them up and understand the concept I think. Basically, instead of having a separate 'type' table I can limit the values permitted to, for example, 'equipment', 'people' 'company'. How many values can you given an enum column? As a side note I am currently using http://ondras.zarovi.cz/sql/demo/ to help plan my database, its a HUGE help. Before I was doing it on paper :-s
  2. Thanks for the reply, I think you kinda getting what I'm looking for. You've described a link table and I understand the concept of the link table i.e. an individual table for associations. My issue is that I need a lot of them and ideally I'd like to streamline them more. I'll give a better example below. Three tables: Equipment People Company Then I have a categories table. This category table has the following records: Pre-Production, Production, Post-Production Now, each of the items in either the Equipment, People or Company tab can have multiple categories so at the moment I need three associate tables: Equipment_assoc (equip_ID, category_ID) People_assoc (people_ID, category_ID) Company_assoc (company_ID, category_ID) I want to know if maybe I can condense those three link tables down into 1, or possibly 2?
  3. I am designing a database at the moment and I'm currently drawing up a structure. One 'problem' i'm having is that I am having to use lots of link tables for the many-to-many relationships, I was wondering if there is a better way of doing it. I have highlighted an example of the problem below. I have two tables: equipment people content Each of the records found in the above tables can then be found in multiple categories. At the moment I have the categories in their own table: categories With this set-up I need to create three link tables to deal with the fact that each item, person or content can have multiple categories: equip/category link people/category link content/category link Is there a better way of doing? I am finding the same problem with other areas of the database too.
  4. That was very helpful indeed, that massively condenses the number of tables I would have had! Thanks a lot. Have started a new topic based on the same database, if you have time your thoughts on that would also be very useful. Cheers.
  5. I am currently planning a database that will store various types of camera equipment and a list of their specifications, however I am unsure the of the best way. Although the categories are not final I will have broad categories such as: Camera Lens Accessories I am proposing a new table for each category so: Table -> Cameras Table -> Lenses However the items contained within each table will have hugely varying specifications for example I may have film AND digital cameras; each with unique specifications i.e. (film format vs. digital format). Is it better to have a huge number of columns for all potential specifications within this one table and then simply leave them blank for items they do not apply to? Or is there a better way of doing it i.e. have a table only for specifications and then linking this to the actual items which will be stored in other tables? Thanks in advance for the help.
  6. Yeah I know now, I wasn't sure if it was something to do with the include (HEADER) thing. I've tried what you've said and thats not actually working. Which area where you referring to with the' document.ready'. I don't actually know javascript apart from how to drop Jquery into my code! Is there a javascript area of this forum?
  7. My header used to contain the following: <!-- Load relevant CSS and Java documents --> <!-- Style Sheets --> <link rel="stylesheet" type="text/css" href=" <?php echo CSS_GLOBAL; ?>" /> <link rel="stylesheet" type="text/css" href=" <?php echo CSS_ARTICLE; ?>" /> <link rel="stylesheet" type="text/css" href=" <?php echo CSS_CXAPP; ?>" /> <link rel="stylesheet" type="text/css" href=" <?php echo CSS_BREAD; ?>" /> <link rel="stylesheet" type="text/css" href=" <?php echo CSS_JQUERY; ?>" /> <!-- Java Script --> <script type="text/javascript" src="<?php echo BREADCRUMB; ?>"></script> <script type="text/javascript" src="<?php echo JQUERY; ?>"></script> <script type="text/javascript" src="<?php echo JQUERYUI; ?>"></script> <!-- Bread Crumb --> <script type="text/javascript"> $(document).ready(function(){ $('#breadcrumbs-3').xBreadcrumbs(); }); </script> <!-- Profile Tabs --> <script type="text/javascript"> $(function() { $("#profiletabs").tabs(); }); </script> I have two areas using javascript. A breadcrumb navigation and some tabs. However to get these to work I have had the move the following into the body of my page because it wouldn't recognise it. When copying to the body I didnt change anything and it just started working. <script type="text/javascript" src="<?php echo BREADCRUMB; ?>"></script> <script type="text/javascript" src="<?php echo JQUERY; ?>"></script> <script type="text/javascript" src="<?php echo JQUERYUI; ?>"></script> <!-- Profile Tabs --> <script type="text/javascript"> $(function() { $("#profiletabs").tabs(); }); </script> All of the links to external javascript had to be taken from the header, but only the actual code for the tabs had to move. The code for the Breadcrumb works fine in the header. Any ideas.
  8. I am doing that, I load my CSS first in my header and then my javascripts after. For some reason it won't recognise them unless I put them in the body though. When they are in the header I know the links to jquery and jquery ui are working because if I view source and click the links it disaplys the actuall .js file contents.
  9. On my page I use an include() to bring in my header. For most of my pages within the header I have links to CSS stylesheets, links to external javascript files, and also javascript snippets coded into the page. My problem is that sometimes the javascript action does not work when the code is in the head, what I have to do is take it from the header file and copy into the body of the page. Anyone have any ideas about this? IT also occasiionally happens with links to external javascript files , my link has to be taken from the header into the body of the page. My current issue is when i'm trying to use Jquery tabs and its this code that is giving me problems: <script type="text/javascript"> $(function() { $("#profiletabs").tabs(); }); </script> Any help is appreciated.
  10. This isn't so much as a question i need answering directly, more of a request for you pro's to direct me to useful tutorials, articles and so forth! I'm building a new site and as a beginner I am unsure how to store pictures for this site. It is a site that will be update with new articles and news each day, similar to a blog, each of which will have some sort of picture of illustration. As such over time I imagine I will end up needing to store a lot of images in an organised way which are easy to retrieve for both the original articles and if I want to use them again. What is the best way of doing this? I have built my databases in MySQL so from what i've read so far I have the choice of storing the actual file in the database, or storing in folders and somehow storing the links in the database. Either way I wouldn't really know how to start! Thanks for any advice.
  11. I have 2 tables: 1 - title (the columns are: titleID, title) 2 - talent (the columns are: talentID, first_name, last_name) Titles in the first table are film titles, and entries in the second tables are actors. There can therefore be multiple actors in one film. How do I show this? I know I need a link table or some sort so that if for example; Indiana Jones = titleID of '1' Harrison Ford = talentID of '1' Steven Spielberg = talendID of '2' The link table would show two columns: col1 - titleID col2 - talentID The link table would then be: titleID talentID 1 1 1 2 I cannot figure out even after hours of trying how to select all talentID in the link table that have a titleID of 1. please help!
  12. Hi, I am trying to design my first link table and struggling despite reading this tutorial: http://dev.mysql.com/tech-resources/articles/intro-to-normalization.html#03 I am working on a movie-based site within which each film has its own page. On a page for a specific film there will be a 'Cast' section in which I want to list all actors from the movie. I have three tables; 'title' for the film details. Each film has a unique filmID 'talent' for the cast details. Each actor has a unique talentID 'film2talent' which I aimed to be the link table. Can someone advise what mysql query I would need to link them together? I do not understand how the link table is populated (i.e. do I populate it whenever I add actors or movies to my databae or do I only populate it when I am running a query?) I guess the logic would be: Look in link table for filmID, select all talentIDs that correspond to that filmID and then select all talent information relating to the talentIDs. How do I do this in mysql code though? Any help is MUCH appreciated!
  13. Thanks that worked! You've been a great help this weekend, much appreciated.
  14. My code is currently like this, how could I simplify it? Possibly using a FOR loop somehow? I also then need to check which of the values is 0 and ignore these. All help is appreciated. $daynew1 =$_POST ['day1new']; $daynew2=$_POST ['day2new']; $daynew3 =$_POST ['day3new']; $daynew4 =$_POST ['day4new']; $daynew5 =$_POST ['day5new']; $daynew6 =$_POST ['day6new']; $daynew7 =$_POST ['day7new']; $daynew8 =$_POST ['day8new']; $daynew9 =$_POST ['day9new']; $daynew10 =$_POST ['day10new']; $daynew11 =$_POST ['day11new']; $daynew12 =$_POST ['day12new']; $daynew13 =$_POST ['day13new']; $daynew14 =$_POST ['day14new']; $daynew15 =$_POST ['day15new']; $daynew16 =$_POST ['day16new']; $daynew17 =$_POST ['day17new']; $daynew18 =$_POST ['day18new']; $daynew19 =$_POST ['day19new']; $daynew20 =$_POST ['day20new']; $daynew21 =$_POST ['day21new']; $daynew22 =$_POST ['day22new']; $daynew23 =$_POST ['day23new']; $daynew24 =$_POST ['day24new']; $daynew25 =$_POST ['day25new']; $daynew26 =$_POST ['day26new']; $daynew27 =$_POST ['day27new']; $daynew28 =$_POST ['day28new'];
  15. I have a form for updating certain records in my database, when the form is submitted I am using UPDATE to replace the relevant corresponding fields in the database. My problem is that my query tries to update all fields therefore if the user has left a field blank in fields that don't need to be changed, when they click submit the query will update those fields with 0 regardless. How do I write my query so that UPDATE only works on fields that have data in them? My query is below: $query = "UPDATE gross SET day1 = '$daynew1', day2 = '$daynew2', day3 = '$daynew3', day4 = '$daynew4', day5 = '$daynew5', day6 = '$daynew6', day7 = '$daynew7' where filmID = '$filmID'"; i.e. if a user changes the value of day1 then I want this to update however if they have not changed day2 I don't want this to update. Thanks for any help.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.