Jump to content

Barand

Moderators
  • Posts

    24,573
  • Joined

  • Last visited

  • Days Won

    824

Everything posted by Barand

  1. As for that '✔', store in your table as 1/0 for completed/not completed. You convert to a '✔' on output, not on input.
  2. You can use the sql function str_to_date() to convert your dates to the correct format. In the mean time you can also use that in your query SELECT GAME, YR, PLATFORM, PUBLISHER, STR_TO_DATE(FINISHED, '%d-%m-%Y') as FINISHED FROM games WHERE COMPLETED='✔' ORDER BY STR_TO_DATE(FINISHED, '%d-%m-%Y') DESC LIMIT 10
  3. What format are you storing them in? You can get away with varchar so long as they are in" yyyy-mm-dd" format. Why the **** are you storing values as '✔' in your database?
  4. I don't know if you are using PDO or MySqli, but whichever it is, use its error reporting functionality to find out why.
  5. EG +---------------+ | school | +---------------+ | school_id |---+ | name | | +--------------+ +---------------+ | | team | +---------------+ | +--------------+ | player | | | team_id |--+ +---------------+ | | team_name | | +---| player_id | +---<| school_id | | | | name | | sport_id | | | | height | +--------------+ | | | weight | | | | email | | | | dob | | | +---------------+ | +-----------------+ | | | team_player | | | +-----------------+ | | | id | | +---<| team_id | | | position | | | player_id |>--+ | played_from | | played_until | +-----------------+
  6. Forget the json then. This should give you the first 5 records in the format your C# is currently expecting $res = $conn->query("SELECT username , level , points , killrate FROM atable ORDER BY points DESC LIMIT 5; "); $data = []; foreach ($res as $row) { $data[] = join('|', $row); } echo join('/', $data);
  7. $res = $conn->query("SELECT username , level , points , killrate FROM atable LIMIT 5; "); $data = $res->fetchAll(); echo json_encode($data); That doesn't look like much of a hassle.
  8. It occurred to me that it might be easier to query for the first 5 records fetchAll() on the result set json encode the array of results then echo the json string. In C#, convert the json back to an array and process.
  9. Very confusing. You say you have 2 entries in the database. Then you say you want the top five entries in the database. Your php code only echoes one entry Not surprised you're having problems. Don't know. This is a PHP forum.
  10. So you're getting the file names, getting the creation dates for those files, storing in an array then sorting the array by date - yes?
  11. I thought that was settled. The timestamp in the notes contains the date. The from and to dates in the season table tell you the season. Job done.
  12. Then for the note table I'd suggest... note_id Timestamp Comment (1st line from above examples) home_team_id away_team_id
  13. If that's the case, how do you get from team = 46 to DeAndre Davis, 6'6" senior guard; Nijel Pack, 5'11" senior guard; DeAnte Davis, 6'6" sophomore forward
  14. Looks like all your note table should have is note_id Timestamp Comment (1st line from above examples) fixture_id Your data model should provide the teams and their players for any given date/fixture
  15. Are you making notes other than the player notes? (Remember, there is only you who knows what you are trying to achieve, what your process are and what your data looks like)
  16. Are you talking about making notes about players during a game? id PlayerID TeamID Timestamp Comments
  17. Just a guess, but do you have several objects with same id (#userDeleteConfirmationModal)?
  18. I would need to review your model before committing. To me, a "player" table would contain player attributes such as PlayerID, Name | Address | Phone | Dob | etc.
  19. I would datestamp the note records rather than store the season code. At least you then know exactly when you made the note. Have a "season" table to define the seasons Season From To 18-19 | 2018-11-01 | 2019-03-31 19-20 | 2019-11-01 | 2020-03-31 Then if you want this season's notes SELECT note_date , note FROM note n JOIN season s ON n.note_date BETWEEN s.From and s.To WHERE CURDATE() between s.From and s.To ORDER BY note_date
  20. try the html attribute instead of the text attribute modal.find('#active-sheets').html(activesheets)
  21. What is the object whose id = active-sheets?
  22. Escape the quotes. IF(Media='Physical', '<img src=\"Images/floppy.png\">', Media) as Media
  23. if you want to do it in the query (as you have above) then something like SELECT IF(Media='Physical', '<img src="images/floppy.png">', Media) as Media
  24. You need "<br>" for newlines in an html document ("\n" and multiple spaces are ignored unless between <pre>..</pre> tags or in a <textarea>)
  25. It certainly doesn't live up to its name.
×
×
  • 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.