Jump to content

Jim R

  • Content Count

  • Joined

  • Last visited

  • Days Won


Jim R last won the day on July 26 2018

Jim R had the most liked content!

Community Reputation

1 Neutral

About Jim R

  • Rank
    Prolific Member

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I thought I noted that as the trigger, but I guess I didn't.
  2. As always, I appreciate the input from others. At its worst, it teaches me which questions to ask, which is always helpful.
  3. For anyone else who comes across this issue here is the answer: ORDER BY (CASE WHEN s2.use IS NULL THEN s2.school ELSE s2.city END)";
  4. Tags, which initially drive the query, are generated by WordPress via Posts, so at some point I still have to match tag name with school name, and since the tags aren't always schools--players too--I have to determine which it is before I can go forward.
  5. Definitely sure. I have triple checked.
  6. OK...I'll likely relent and combine some city/school into school name. Maybe create a trigger in the database. (I guess I could do that.) But check this one out: https://www.courtsideindiana.com/tag/carmel/ Only Hamilton Southeastern has City filled. The rest are NULL, but Zionsville shows up second. WTF? I checked for white spaces in the columns. There appears to be nothing irregular about the data.
  7. I have no problem printing it out how I want it. Asking for help on how to better order/sort it. Order By likely isn't the answer, but creating an array and sorting the array might be. Just not sure of the syntax.
  8. Can't I query it out and sort it on the backend rather than creating all that extra data input? Can't I sort an array? That's what I was seeking initially, trying to get some syntax help.
  9. There are parts of the site regular users don't get to see, and the city breakdown is helpful without it being repetitive.
  10. Because it's not. Lafayette Jefferson goes by Lafayette Jefferson High School. McCutcheon High School in Lafayette just goes by McCutcheon. Harrison High School in West Lafayette goes by Harrison High School. There is also Harrison High School in Evansville. There are nine schools in Indiana with Central as their name or in their name. There are other instances of this with other words--North, South, East, West, Christian, Catholic, Prep, etc.
  11. There is another part of the site where I want them to be distinctly separate.
  12. Filling both columns won't change anything. The city name isn't always relevant to how the school is referred to, but I do use the city name in other areas. I'll look up coalesce. Thanks.
  13. Yes it does matters. It matters to my Users, and it matters to those who want to see their school represented as the school is named. It matters to me.
  14. Can I do that via a function on the same file and referring to the function?
  15. I have three columns -- Use | City | School In cities where the school is just the name of the city, city is NULL. In cities that have multiple schools or the name of the school isn't *just* the name of the city I fill in the city name, but the name of the city isn't always incorporated into the school name. https://www.courtsideindiana.com/tag/mccutcheon/ On the right hand side of the page, it prints: Kokomo Logansport Marion Lafayette Jefferson McCutcheon Harrison It should read: Harrison Kokomo Lafayette Jefferson Logansport Marion McCutcheon (I have a trigger that determines when to print the city into the name and when not to.) The data table columns look like this (I struck out the city names not being used in printing the school name) Use | City | School 0 | NULL | Kokomo 0 | NULL | Logansport 0 | NULL | Marion 1 | Lafayette | Jefferson 0 | Lafayette | McCutcheon 0 | West Lafayette | Harrison The query is actually looking for the teams in the same Sectional (bsect) as the featured school -- in the linked case above, McCutcheon. $query = "SELECT use,city,school from a_schools as s1 LEFT JOIN a_schools as s2 ON s1.bsect = s2.bsect WHERE '" . $query_school . "' = CONCAT(s1.city,' ',s1.school) || '" . $query_school . "' = s1.school ORDER BY concat(s2.city,s2.school) asc"; (The WHERE has to look for examples where it's just the school name OR examples where the city is incorporated in the school name.) In a lot of instances, how I have this ordered works, which is why I have it that way, but this is definitely an example where it doesn't. Do I wait to sort after the query?
  • 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.