
Jim R
Members-
Posts
1,008 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Jim R
-
This is a strange one, as I have many forms on my various sites, and on this site, the file in question is used by several functions. Ultimately, I'm wanting it INSERT values from the form, which I'll eventually add more of. Form is process and is stent to rn_process.php, which is the code listed below. include(ABSPATH ."resources/con.php"); $grade = $_POST['grade']; $position = $_POST['position']; echo $grade.$position; $query = "INSERT INTO a_rankings_select (username,userID,grade,position) VALUES ('" .$username. "', '" .$userID. "', '" .$grade. "', '" .$position. "')"; It echoes the correct $grade and $position when I comment out the INCLUDE. So I know it's passing the correct values. However, when the INCLUDE is active, I get the following error: resources/con.php is a file I link to many times, and it's work in those instances. It's certainly not executing the INSERT.
-
I appreciate that, but I'm trying to avoid typing all of that in the future, especially in regards to a player's name.
-
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?