Jump to content

skyace888

New Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

skyace888's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I think I got it. This seems to work for me. SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(products_name, ' ', 2), ' ', -1) AS last_name, SUBSTRING_INDEX(products_name, ' ', 1) AS first_name FROM products_description ORDER BY last_name, first_name; Is there a better way to do this? Also, if you happen to have worked with the OSCommerce package before, where on the index.php page (and any other pages) do I need to make my modifications? Thanks again...
  2. Thanks for the reply, toplay. This query doesn't appear to be working properly for me. I forgot to mention that many of the rows have more than two strings in the name field such as "John Doe 1985" or "Chris Davis Special Edition". I noticed that the "-1" appears to take the last string from the field. When I run the query, all but a few of the last names are shown under last_name. Is there a way to nest this function? Again, I am trying to sort this by the second string in the field. Thanks...
  3. I am finishing up work on an OSCommerce setup for someone and they had a request. Most of the products are named by a person's name such as "John Doe" or "Joseph Dean". By default, the products are sorted by the first name in each category. Is there a way I can sort the products by last name so "Joseph Dean" comes before "John Doe"? I don't want to have to change the names of the products to a "lastname, firstname" format. Also, all of the items are already in the database and we are talking about 5000+ products. Any suggestions are greatly appreciated. I already posted this in the OSCommerce forum, but figured I'd ask here as well since it's more of a database question. Thanks, Al
  4. Thanks fenway!  I think that did the trick.  I know basic SQL but this one is out of my league!
  5. I am working on a PHP/MySQL statistics tracking program for a basketball team.  It is something I'm doing for a class.  I have two tables, Play_Log and Play_Outcome_Log, for which I need to run a query on.  Here is what I have so far: SELECT OutcomeID, Code1 FROM Play_Outcome_Log, Play_Log WHERE Play_Outcome_Log.OutcomeID=5 AND Play_Outcome_Log.PlayID = Play_Log.PlayID AND Play_Log.PlayCode='O' I am trying to run a query that tells me the player number with the most 2-point baskets on the team (in this example).  The OutcomeID represents the code of the play.  "5" is for a 2-point basket.  Since I want it for the main team, I choose 'O' for PlayCode meaning offensive.  Here is what was returned: OutcomeID  Code1 5              3 5              3 5              32 I have not added all of the plays in, but at this point, player #3 is the one with the most 2-point baskets.  How can I change the query so I only receive this one number as my result (the player number with the most 2-point baskets)?  Hopefully I have explained this clearly. Thanks, Al
  6. I am trying to implement the model I designed at [url=http://education.alcodesigns.net/projects/coursework/dbmodel9-19-06.gif]http://education.alcodesigns.net/projects/coursework/dbmodel9-19-06.gif[/url] using PHPMyAdmin.  I am having trouble getting the "PLAYERS" table right.  I need to have two primary keys and "TeamNumber" needs to be a foreign key that references TEAM -> Number.  Can this be done?  If so, how? Thanks, Al
  7. Hi fenway!  I don't expect anyone to do my homework for me, rather I came here hoping someone could provide some suggestions and lead me in the right direction.  Anyways, I think I have the "Players", "Team", and "Program" regions in my database map setup correctly.  Those were pretty straightforward.  I'm having difficulty figuring out how to design the "Game" region.  According to the Word sample file, I need to record all the offensive and defensive plays in the game.  I'm not sure if I should make this in one table, called "PLAY_LOG", or have an offensive and defensive log separate.  In addition, every play has an outcome and some of these outcomes need additional fields for player numbers.  I think I have the "GAME_INFO", "TIME_OUT", and "TIMEOUT_LOG" setup correctly.  The program is supposed to be able to allow for queries such as "What was the success rate of play x when players a, b, c, d, and e were on the court?"  I have worked with databases that track orders and products in the past, where there are many examples, however this one is proving more challenging.  Maybe I am not interpreting the sample data correctly... Thanks, Allen
  8. Ok.  I took care of making the image smaller.  I didn't realize it was that large.  Thanks for pointing that out, AndyB.
  9. I'm currently taking a directed project course at my university and need a little assistance setting up the design of a database.  I'm working on a PHP/MySQL program for coaches to track the statistics of a basketball team.  I'm using DBDesigner4 to design the database.  My current model is at [url=http://education.alcodesigns.net/projects/coursework/db_schema9-9-06.gif]http://education.alcodesigns.net/projects/coursework/db_schema9-9-06.gif[/url].  My foreign keys that I have so far: PLAYERS(TeamNumber) is a foreign key to TEAM(Number) MEMBERS(TeamNumber) is a foreign key to TEAM(Number) TIMEOUT_LOG(GameID) is a foreign key to GAME_INFO(GameID) The sample file with explanations is at [url=http://education.alcodesigns.net/projects/coursework/samplefile.doc]http://education.alcodesigns.net/projects/coursework/samplefile.doc[/url].  I'm not sure how I can efficiently log all the offensive and defensive plays based on the information in the file.  Each play has an outcome that must be recorded as well.  Any suggestions are greatly appreciated! Thanks, Al
×
×
  • 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.