Jump to content

Jim R

Members
  • Posts

    1,006
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Jim R

  1. Never mind. I figured it out. I had team_profile() in the team_profile function. It was creating an endless loop that was only halted by the connections error. I'm an idiot!
  2. This function determines if we have a Player's name or Team function team_or_player () { /// /// /// Determine if it's a player or a team or player profile /// /// This function is located in the /plugins/td-standard-pack/newspaper/tag.php /// /// // tag or search if (function_exists( 'single_tag_title' )) { $tag = single_tag_title("", false); } else { $tag = get_search_query(); } include(ABSPATH ."resources/con.php"); $query = "SELECT nameFirst,nameLast,city,school,position,grade FROM a_players WHERE CONCAT(nameFirst,' ', nameLast) = '".$tag."'"; $results = mysqli_query($con,$query); echo mysqli_error($con); if($line = mysqli_fetch_assoc($results)) { $name = "{$line['nameFirst']} {$line['nameLast']}"; echo $name; // Just to make sure it's getting the intendeded result player_profile(); } else { echo 'Team'; // Just to make sure we're getting passed to Team team_profile(); } /// ////// End Team or Player /// mysqli_close($con); } Passing it to the Player Profile works just fine. Passing it to the Team Profile (code in the OP) works, but the query produces 23 instances.
  3. I think the 23 instances of Brownsburg and Team1 is what is triggering the error. When I remove the query and establish and echo $tag it works fine. I don't see anything in the query that would lead to 23 instances of Brownsburg and Team1.
  4. On one of my sites, I have created a number of custom functions to put into my WordPress installation. Suddenly I'm getting a max user connection error. Here is the page it's showing: https://www.courtsideindiana.com/tag/brownsburg/ The right hand side of the page are two of my custom functions. The content above Tag: Brownsburg is a custom function, which is supposed to just have test content. The odd behavior also is there should just be one Brownsburg listed and one Team1 (not 23). I have tried to close each connection mysqli_close($con); If it would matter, the query is below: function team_profile() { // // ////////// begin team profile // // include(ABSPATH ."resources/con.php"); // Tag or Search if (function_exists( 'single_tag_title' )) { $tag = single_tag_title("", false); } else { $tag = get_search_query(); } echo $tag .'<br>'; // just to test $query = "SELECT * FROM a_schools WHERE (school = '" .$tag . "' || concat(city,' ',school) = '".$tag."')"; // End tag vs search term, finish the query $results = mysqli_query($con,$query); echo mysqli_error($con); if($line = mysqli_fetch_assoc($results)) { $school = "{$line['city']} {$line['school']}"; if($line['school'] == $tag) { team_profile(); echo 'Team 1'; // just to test } else { team_profile(); echo 'Team 2'; // just to test } } mysqli_close($con); }
  5. I should've said, not every row has that. The ones which don't are either NULL or a different city altogether.
  6. Here are my examples: City | School Bloomington | Bloomington North Columbus | Columbus East Fort Wayne | Fort Wayne Bishop Dwenger I have several of these. I want to remove from School what already is in City.
  7. I've tried this, but it doesn't change the result. I'm not really sure the order has much do with it, unless it's inside a loop or directly passing information along. I've echoed it within the function. I've put it after the ?>. I posted that above in the OP. No matter I've put it, the CSS works, but it creates header errors. I have other PHP files with CSS links above the <?php without these errors. I'm wondering if it's a function issue. What I'm working on at the moment, it worked fine until I tucked it into a function vs. using INCLUDE. I was surprised echoing it in the PHP code triggered the error.
  8. I figured the later, since there was an error. Back to the original question, maybe a little more specific. How to link the .css file without creating the header error?
  9. I'm trying to link think a .php file full of functions to the following stylesheet I have it above the <?php tag. I have tried echoing it inside the <?php and ?>, but it produces the same error. Getting this error:
  10. It didn't include the Players table. Unless I missed something, it was just joining seasons and notes.
  11. Table structure isn’t at issue, other than adding a Seasons table. Can we please just focus on the date stamps and seasons?
  12. I copy the team ID from the teams table over to the player_previews table as I need them over from the team tables, and the WordPress shortcode I created matches it.
  13. I'm not drawing from my own games/fixture table. There are several games on each preview, and I'm just using the table to put out a consistent list of players for the team I write briefly about. I'm getting what I need/want right now other than matching date stamps based on a the applicable season. Notes table: date stamp Players table: date stamp Seasons table: start_date, end_date
  14. Here is a sample Note/preview: That's what is what the reader sees. Here is what I type: Then that team number in the shortcode is run the query above to produce the list. I now want to add a time element to it, based on the timestamp of the Note posting so as the seasons change, it accesses new instances each year. I only need to focus on the date stamp of the Note/preview with the date stamp in my Players table and make sure they come from the same Season (range of dates).
  15. No...these are preview notes, where I write about the team. I created a shortcode in WordPress to access the data for each team. I want to make sure each instance/row stays true to its season as time marches on. I'm just in need of the time/season issue.
  16. So I need to refer to the timestamp of the Note, then match it to the timestamp of entry into the Players (a_game_preview_players) table, relative to the date range provided for reach season. This is what I had before getting to this timestamp issue. $query = "SELECT * FROM a_game_preview_players where teamID = '" . $team . "'"; $results = mysqli_query($con,$query); echo mysqli_error($con); while($row = mysqli_fetch_assoc($results)) { return '<b>' . $row['school'] . '</b><br/>' . $row['players']; }
  17. It's just a CSV list for each team I've been typing out as I need it. It's not a comprehensive list of players. Out of 410 schools, there will be about 30 of them I write about repeatedly. (Side note: I do have a table for players, but it's way more extensive than my needs for the above, and it would require me to distinguish which ones to list. If I get to a point where I find that would be more efficient from a work flow perspective, I'd likely be able to adapt what we're doing here to access the main players table. I just really needed help on how to reference a date range without hard coding it into the query or having to note the season each time I access the query.)
  18. Question first: I'll have a Notes table, which timestamps when the note is made. Then i'll have this Players table (columns noted above), which I will have timestamp when each entry is made. Then I'll have a Seasons table, defining each season. So I will query the Notes and Players table, relevant to the date range set up by the Seasons table, right?
  19. Makes sense! I'll play around with it today. (I'll likely be back.) That will likely help me with the scheduling query you helped me with, as there will definitely be some archiving there as well.
  20. Querying data for Notes that will have new instances each season (November 1-March 31), and as each season passes by I want the information produced to reflect the information at the time the query was made. (This is for scouting) Columns are... id schoolID (copied from another table) players season So for example, I want each time I use this query for a Note from November 1, 2019 through March 31, 2020, to use rows where season = '19-20', and as we move into next season '20-21' I'll create new instances for each school I use. The previous seasons of information will be archived but still viewable, so when someone goes back to read information from 2019-2020 season, I want the 19-20 rows to still be showing. I'm thinking this through as I'm typing... As I'm creating these Notes, they do leave a post date yyyy-mm-dd, I'd assume I could use that as a reference point.
  21. There was a light plugin via WordPress that took care of it. Not sure it "solves" the problem, but then again, it could be a WordPress/theme issue. As long as it works, I'm good.
  22. Not as intended, and I had tried that earlier. Sticky is supposed to keep the DIV relative until the "Top" is reached, then stick there. Maybe it's a theme issue too that I'm using for WordPress, as it hides behind the main navigation until that is off screen. I need it visible the whole time. I thought I was doing well to find the "main" issue that keeps "sticky" from working (overflow: hidden;), but I don't have that issue.
  23. BTW...the DIV in question is in red, and I'm trying to get it to stick to the top of the browser as the User scrolls down.
  24. Here is the page in question: https://www.courtsideindiana.com/season-preview/19-20/sectional1920/?sectional=8 I don't have any -- overflow: hidden; -- issues, at least not from what I see when I inspect the element. I do my work in Safari, but I test a lot in Developer mode as well as a separate Chrome browser. CSS div.navigation { position: -webkit-sticky; position: sticky; top: 0px; background-color: red; padding: 10px; font-size: 20px; } PHP/HTML echo '<div class="navigation">Hello</div>';
  25. I went back to this query: SELECT * FROM a_players WHERE team=' .$team.' ORDER BY nameLast ASC'; Everything appears to be working. Does anyone have any idea why adding %26 would change the results of what even gets noticed?
×
×
  • 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.