Klance Posted April 12, 2008 Share Posted April 12, 2008 Ok, so I have a form where you can enter the type of console and the difficulty of the game and it's put into one table. So say I want to view PS2 difficulty HARD how would I select only records that have console PS2 AND difficulty HARD using a MySQL query? Link to comment https://forums.phpfreaks.com/topic/100828-solved-how-do-i-only-select-certain-mysql-records/ Share on other sites More sharing options...
darkfreaks Posted April 12, 2008 Share Posted April 12, 2008 <?php $sql="SELECT *FROM ps2_console WHERE hard=$hard ORDER BY $hard"; $result= mysql_query($sql) or die(mysql_error()); ?> Link to comment https://forums.phpfreaks.com/topic/100828-solved-how-do-i-only-select-certain-mysql-records/#findComment-515603 Share on other sites More sharing options...
CrustyDOD Posted April 12, 2008 Share Posted April 12, 2008 SELECT FROM ... WHERE console = 'PS2' AND difficulty = 'HARD' That's about it Link to comment https://forums.phpfreaks.com/topic/100828-solved-how-do-i-only-select-certain-mysql-records/#findComment-515605 Share on other sites More sharing options...
Klance Posted April 12, 2008 Author Share Posted April 12, 2008 Thank you that worked. Link to comment https://forums.phpfreaks.com/topic/100828-solved-how-do-i-only-select-certain-mysql-records/#findComment-515661 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.