Home Passing values through a variable in PHP
Reply: 0

Passing values through a variable in PHP

user2649
1#
user2649 Published in July 19, 2018, 9:58 am

I am having a few issues with a basic program I am working on: I am aiming to take the 4 learning dimensions from the table indexLearningStyle such as (Mildly active, moderately active and so on) I am then aiming to print feedback from the ilsFeedback table based on the previous dimensions. However regardless of the preempting value such as Mildy or Strongly I want to print general feedback.

<?php

    $mildlyActive = "active";
    $moderatelyActive = "active";
    $stronglyActive = "active";

    $mildlyReflective = "reflective";
    $moderatelyReflective = "reflective";
    $stronglyReflective = "reflective";

    $mildlySensing = "sensing";
    $moderatelySensing = "sensing";
    $stronglySensing = "sensing";

    $mildlyIntuitive = "intuitive";
    $moderatelyIntuitive = "intuitive";
    $stronglyIntuitive = "intuitive";

    $mildlyVisual = "visual";
    $moderatelyVisual = "visual";
    $stronglyVisual = "visual";

    $mildlyVerbal = "verbal";
    $moderatelyVerbal = "verbal";
    $stronglyVerbal = "verbal";

    $mildlySequential = "sequential";
    $moderatelySequential = "sequential";
    $stronglySequential = "sequential";

    $mildlyGlobal = "global";
    $moderatelyGlobal = "global";
    $stronglyGlobal = "global";

    $dbQuery = $db->prepare("select dimension1, dimension2, dimension3, dimension4 FROM indexLearningStyle WHERE studentNumber = '".$currentUser."'");
    $dbQuery-> execute();

    while ($dbRow = $dbQuery->fetch (PDO::FETCH_ASSOC)) {
    $dimension1 = $dbRow["dimension1"];
    $dimension2 = $dbRow["dimension2"];
    $dimension3 = $dbRow["dimension3"];
    $dimension4 = $dbRow["dimension4"]; 

    }

    $dbQuery = $db->prepare("select answerType, studentDefinition FROM ilsFeedback");
    $dbQuery-> execute();

    while ($dbRow = $dbQuery->fetch (PDO::FETCH_ASSOC)) {
    $answerType = $dbRow["answerType"];
    $studentDefinition = $dbRow["studentDefinition"];

    }

    if ($dimension1 = $mildlyActive or $moderatelyActive or $stronglyActive){
    $dbQuery = $db->prepare("select answerType, studentDefinition FROM ilsFeedback WHERE answerType = 'active'");
    $dbQuery-> execute();
    $studentDefinition = $dbRow["studentDefinition"];
    echo $studentDefinition;
    }
else {
    if ($dimension1 = $mildlyReflective or $moderatelyReflective or $stronglyReflective){
    $dbQuery = $db->prepare("select answerType, studentDefinition FROM ilsFeedback WHERE answerType = 'reflective'");
    $dbQuery-> execute();

    $studentDefinition = "studentDefinition";
    echo $studentDefinition;
    }
}




?>  
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.800033 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO