Jump to content

Revolutsio

Members
  • Posts

    85
  • Joined

  • Last visited

Everything posted by Revolutsio

  1. with the code i put in i get the 30 November -0001 i tried to use phpmyadmin to use the select command from your reply and i get all blank when echo finished
  2. $date = $row['FINISHED']; IF($date == '0000-00-00') { $date=''; } else { $parts = explode('-',$date); $date = date('d-m-Y', mktime(0,0,0,$parts[1],$parts[2],$parts[0])); } I have tried this code and i get 30 November -0001
  3. Thank you i will try this. Now with the date query, when i show the page with items that have not been completed i get the date '0000-00-00' how do i change this , i searched on here and found the same problem but it did not work with my code. How do i make this date blank if 'FINISHED' = '0000-00-00' if (FINISHED='0000-00-00', '', FINISHED) as FINISHED i have tried this but get '01 January 1970' and if I put a space in the second quotes I get today's date , a little bit confused
  4. Thank you everybody for your help, I remembered that the code uses the date format and it now works.
  5. 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.
  6. no there are stored as varchar, the database is from a google spreadsheet
  7. 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
  8. Thank you for your help
  9. 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;";
  10. 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.