Jump to content
#FlattenTheCurve ×

Revolutsio

Members
  • Content Count

    31
  • Joined

  • Last visited

Everything posted by Revolutsio

  1. As i said in a previous post, I have put this database together on a google spreadsheet and downloaded it to a csv doc and then imported it to Mysql with PHPMyAdmin. The date format on the sheet is in the format dd-mm-yyyy. As above the tick is from the spreadsheet and it shows if i have completed a game.
  2. no there are stored as varchar, the database is from a google spreadsheet
  3. I have some PHP code that should give me the dates in year order but it is giving me the date order. So it shows a list of 10 items in the following order see attached png it should show the ten items i sorted by year then month then day, <?php $sql = "SELECT GAME, YR, PLATFORM, PUBLISHER, FINISHED FROM games WHERE COMPLETED='✔' ORDER BY FINISHED DESC LIMIT 10;"; $result = mysqli_query($conn, $sql) or die("Bad Query: $sql"); $num_rows = mysqli_num_rows($result);?> <?php while ($row = mysqli_fetch_assoc($result)): ?> <tr> <td><?php echo $row['GAME']; ?></td> <td><?php echo $row['PLATFORM']; ?></td> <td><?php echo date('d F Y', strtotime($row['FINISHED'])); ?></td> <tr> <?php endwhile; ?> This use to work on until this week
  4. Hi thank you for your reply, I have tried the above code and I get a error Parse error: syntax error, unexpected 'Images' (T_STRING) here is my Select code <?php $sql = "SELECT ID, GAME, YEAR, PLATFORM, PUBLISHER, Owned, COMPLETED, Media, Launcher, IF(Media='Physical', '<img src="Images/floppy.png"">', Media) as Media FROM games;";
  5. Hi I have a database with all my game collection on and have the code to display it on a webpage, my problem is in one field called Media, i have the text 'Physical' in it and i would like to change this within PHP to an image of a floppy disk when it displays on the webpage. Can this be done. I have done something similar with and if statement to display a 'tick' instead of a 1. IF ( owned = 1, '✔', 'X' ) AS owned, IF ( completed = 1, '✔', ' ' ) AS completed i would like to do this as above rather than adding it to the MySQL database - the floppy image is on my computer in a folder called Images.
×
×
  • 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.