Jas Posted February 25, 2009 Share Posted February 25, 2009 Hello, I have a few labelled tests/quizzes... but the way my code is written it is not being picked up in the right area: I have a test id:26 which should be part of plan a and not b. The current code is as : (($quiz < 10 AND plan_type = 'a') OR ($quiz > 10 AND plan_type = 'b'))")); As you can see the plan_a excludes the 26 test ID and puts that in plan_b... How can I add 26 to the code so it is recognised as plan-a.. Thanks in advance Jas Link to comment https://forums.phpfreaks.com/topic/146914-need-your-help-pls/ Share on other sites More sharing options...
MatthewJ Posted February 25, 2009 Share Posted February 25, 2009 post the rest of the code Link to comment https://forums.phpfreaks.com/topic/146914-need-your-help-pls/#findComment-771305 Share on other sites More sharing options...
Jas Posted February 25, 2009 Author Share Posted February 25, 2009 mysql_select_db($database); $quiz_names = array( 1 => "hshjhsjhjs", 2 => "kldlkldlklkaka", 26 => "woroiowioiowi", 4 => "alkalklslksklkd", 5 => "wieiuiuieuwiuiq", etc etc./. // get the starting day list($within30days, $purchase_date, $back30days) = mysql_fetch_row(mysql_query("SELECT DATE_ADD(purchase_date, INTERVAL 30 DAY) > NOW(), DATE_FORMAT(purchase_date, '%Y-%m-%d'), DATE_FORMAT(DATE_SUB(NOW(), INTERVAL 30 DAY), '%Y-%m-%d') FROM test WHERE username = '$my_username' AND (($quiz < 10 AND plan_type = 'a') OR ($quiz > 10 AND plan_type = 'b'))")); if ($within30days) $startday = $purchase_date; else $startday = $back30days; // Percentile list($last_date, $accuracy, $percentile) = mysql_fetch_row(mysql_query("SELECT FROM_UNIXTIME(time_finish, '%d/%m/%y'), ROUND(no_correct/no_total*100,0), percentile FROM quirex_record WHERE taker_name = '$my_username' AND quiz_id = '$quiz' AND FROM_UNIXTIME(time_finish) >= '$startday' ORDER BY time_finish DESC LIMIT 1")); list($num_taken) = mysql_fetch_row(mysql_query("SELECT COUNT(*) FROM quirex_record WHERE taker_name = '$my_username' AND quiz_id = '$quiz' AND FROM_UNIXTIME(time_finish) >= '$startday'")); if ($quiz < 10||$quiz == 26) { include("./results_a.php"); } else { include("./results_b.php"); } ?> Link to comment https://forums.phpfreaks.com/topic/146914-need-your-help-pls/#findComment-771310 Share on other sites More sharing options...
Jas Posted February 25, 2009 Author Share Posted February 25, 2009 come on there must be some one who can help or guide where I can look.... I am so stuck as I have no programmer and I am not a coder... Link to comment https://forums.phpfreaks.com/topic/146914-need-your-help-pls/#findComment-771325 Share on other sites More sharing options...
Jas Posted February 25, 2009 Author Share Posted February 25, 2009 bump Link to comment https://forums.phpfreaks.com/topic/146914-need-your-help-pls/#findComment-771364 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.