machina12 Posted June 19, 2007 Share Posted June 19, 2007 In question #1, I am wondering how to use a query that will only work if two values are correct. (figure doing 3 or more, will just follow the same method) So in this instance: if id='345' and score>200 then $query=good from here Within this question, I will end up INSERTing values into another database, which will store 'id' and '$score', so in this case I am mainly focused on the "and" statement, how should tag be written to allow for multiple values to be met? =============================================================================== In question #2, I am wondering how then use a query to cross-evaluate values, and only work if values meet criteria. So in this instance: If one players values meet one set of criteria, and anothers meet another, do something. EX: if id='345' and score='200' and id='20' has score='150' $query=good from here Within this question, I am wondering how to have a few fields being analyzed, and if criteris is met, and only if met, put a value within new database as well as new id tag for this cross-evaluation....that way records can be tracked later. BASICALLY HOW TO CODE FIRST PART CORRECTLY, ANY HELP WITH QUERY SUGGESTIONS IS APPRECIATED TOO. So how would I insert the given evaultion's value into the seperate database...with only player id and cross-evaluation value? EX: columns would be: 'id' 'crossevaluationA' The id would be possibly a combo of users id's, so id 001 and id 002 ineract, it places a new id 001002 and value for interection...could start with 001. Proper Tags? This is it in a nutshell! Any help is appreciated. Link to comment https://forums.phpfreaks.com/topic/56245-multiple-evaluations/ Share on other sites More sharing options...
Dragen Posted June 19, 2007 Share Posted June 19, 2007 the first part would be something like: <?php if(id = '345' && score > 200){ //settings are correct carry out code }else{ //settings are not correct. } ?> Link to comment https://forums.phpfreaks.com/topic/56245-multiple-evaluations/#findComment-277790 Share on other sites More sharing options...
jvrothjr Posted June 19, 2007 Share Posted June 19, 2007 Is this what your looking for? IF ($vl1 == "YES" AND $vl2 = 'YES') { $querystring = "select * from tblname"; } IF ($vl1 == "YES" AND $vl2 = 'YES') { IF ($vl3 == "OK" AND $vl4 = 'CHECK') { $querystring = "select * from tblname"; } } Link to comment https://forums.phpfreaks.com/topic/56245-multiple-evaluations/#findComment-277815 Share on other sites More sharing options...
cooldude832 Posted June 19, 2007 Share Posted June 19, 2007 from a logical point if your not going to gather too much info take more than you need out of the SQL and then sort it out with while, else/if and switches. Otherwise try putting some operators in your query like WHERE `id` = $id || `score` = $score, but if you only going to return 2-3 fields and under a thousand results take more than you need and sort it out in post Link to comment https://forums.phpfreaks.com/topic/56245-multiple-evaluations/#findComment-277821 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.