
Jim R
Members-
Posts
1,006 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Jim R
-
The function itself is in a separate file. There are four things I''m using about 10 times over, and a couple of them I tinker with. Every time I make a change, I have to alter all instances.
-
I didn't have the variables in both where I created the functions and where I used it. Thank you!
-
Ehhh...I'm self taught, and it's a hobby. I run into learning curves.
-
I did not want the DIV in there. I removed it. No change. It looks like the function isn't getting the data into it. I tried putting the variables between the ( ), but that just threw an error.
-
I'm using this line a lot on my site. It would be nice if I didn't have to change it 10 times over when I decide to change something. Can I wrap that into a Function and use it in a While loop? echo '<div><a href="/tag/'. strtolower($nameFirst) . '-' . strtolower($nameLast) .'">'. $nameFirst . ' ' . $nameLast .'</a>, '; I have this above it in the While loop. $nameFirst = $row['nameFirst']; $nameLast = $row['nameLast']; My function predictably looks like this... function player_name () { echo '<div><a href="/tag/'. strtolower($nameFirst) . '-' . strtolower($nameLast) .'">'. $nameFirst . ' ' . $nameLast .'</a>, '; }
-
Ugh...I hate typos. Thanks, as always. I figured it was something simple.
-
I need to match the city and school in two tables (CONCAT) so I can determine whether or not they use the toggle column. Toggle is in a_schools city and school are in both The others are in a_players (I'm sure someone will ask why a_players table doesn't have/use teamID, but it's not effective for my people (or me) to enter names.) With LEFT JOIN it gives me the list I should get, 15 rows. However, the toggles are all NULL. Two should have "1". Here is the query: SELECT nameFirst,nameLast,feet,inches,p.city,p.school,grade,position,grouping,rankPos,toggle FROM a_players p LEFT JOIN a_schools s ON CONCAT(p.city,p.school) = CONCAT(s.school,s.school) WHERE position ='3' AND grade='23' AND grouping ='2' ORDER BY rankPos
-
Correct. I do apologize for not being clear. I'll change it to wrap.
-
http://wolomarketing.com One the desktop, I have a checkerboard pattern set up with two columns and four rows. Navy | Light Blue *Light Blue | Navy Navy | Light Blue *Light Blue | Navy * Class name: .row-reverse On the phone, it shows as one column as... Navy Light Blue Light Blue Navy Navy Light Blue Light Blue Navy I would like it to show up as... Navy Light Blue Navy Light Blue Navy Light Blue Navy Light Blue This was my last effort at reordering the DIVs. The DIVs leading with Light-Blue has a class name of row-reverse. .row-reverse < .span_12 { display: flex; flex-flow: row; flex-wrap: wrap; }
-
I thought I noted that as the trigger, but I guess I didn't.
-
As always, I appreciate the input from others. At its worst, it teaches me which questions to ask, which is always helpful.
-
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)";
-
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.
-
Definitely sure. I have triple checked.
-
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.
-
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.
-
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.
-
There are parts of the site regular users don't get to see, and the city breakdown is helpful without it being repetitive.
-
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.
-
There is another part of the site where I want them to be distinctly separate.
-
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.
-
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.
-
Max User Connection error...can't connect to mysql database
Jim R replied to Jim R's topic in MySQL Help
Can I do that via a function on the same file and referring to the function? -
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?
-
Max User Connection error...can't connect to mysql database
Jim R replied to Jim R's topic in MySQL Help
Yes, it's connecting the function to the database, appearing in every function, but what was causing my issue at hand was me creating an endless loop and it ending at my server connections limit. I tried referring to a global connection, but I didn't get it to work. I'm closing every connection at the end of each function.