PHP - Moved: Multiple Where Clauses
This topic has been moved to MySQL Help.
http://www.phpfreaks.com/forums/index.php?topic=312346.0 Similar TutorialsHello, I'm fairly new to php and I'm working on a website for a chess club. I'd like the user to select all of his or her personal results from a general results table. The results table looks as follows: id name_white name_black result season_id 1 john pete 1-0 2010-2011 2 charles steve 0-1 2010-2011 3 richard john 1-0 2010-2011 etc 11 isaac john 1-0 2011-2012 12 william kate 0-1 2011-2012 13 john bobby 1-0 2011-2012 etc Let us say that the user wants to see all the results of player john in the 2010-2011 season. The following query (probably quite naively) gives me the error "supplied argument is not a valid MySQL result resource": Code: [Select] $result_personal = mysql_query("SELECT * FROM results WHERE name_white = '$seleted_name' AND name_black = '$selected_name' AND season id ='$selected_season'"); Could anyone help me steer in the right direction? Should I use a JOIN query instead? Or a IN query? All the best and thanks in advance for your time, Wouter. This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=351561.0 This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=346367.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=357586.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=318058.0 This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=356538.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=315554.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=351407.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=305991.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=348013.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=344772.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=325508.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=305902.0 This topic has been moved to Application Frameworks. http://www.phpfreaks.com/forums/index.php?topic=352167.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=330871.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=357764.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=312377.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=321924.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=320940.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=313325.0 |