title: Some variables passing but others arent in an included php file
body: <p>I have a included file for storing variables that are to be changed later on through a panel.
  I have a handful of variables that are passing perfectly fine in the same file and fashion as the others.</p>
  <pre><code>&lt;?php
  
      include 'functions/dbfunctions.php';
      include 'functions/variables.php';
  
  ?&gt; 
  </code></pre>
  <p>So this is the include and the variable file is :</p>
  <pre><code>&lt;?php
      
  //Enables
  
  $headEnable = getDb('boxes_enabled', 'box1_header');
  
  //Box 1
  
  $headTitle = getDb('boxes', 'box1_header');
  $headDesc = getDb('boxes', 'box1_info');
  $headPlay = getDb('boxes', 'box1_play');
  
  //Cards
  
  $cardTitleA = getDb('boxes', 'card1_title');
  var_dump($cardTitleA);
  $cardInfoA = getDb('boxes', 'card1_info');
  var_dump($cardInfoA);
  $cardTitleB = getDb('boxes', 'card2_title');
  var_dump($cardTitleB);
  $cardInfoB = getDb('boxes', 'card2_info');
  var_dump($cardInfoB);
  $cardTitleC = getDb('boxes', 'card3_title');
  var_dump($cardTitleC);
  $cardInfoC = getDb('boxes', 'card3_info');
  var_dump($cardInfoC);
  $cardTitleD = getDb('boxes', 'card4_title');
  var_dump($cardTitleD);
  $cardInfo = getDb('boxes', 'card4_info');
  var_dump($cardInfoD);
  
  
  ?&gt;
  </code></pre>
  <p>Now the Enable and Head variables work fine, they show and have no problem, but the Card variables just dont pass.</p>
  <pre><code>&lt;?php if($headEnable == 1) { ?&gt;
                  &lt;section id=&quot;banner&quot;&gt;
                      &lt;div class=&quot;content&quot;&gt;
                          &lt;h2&gt;Welcome to &lt;?php echo $headTitle; ?&gt;&lt;/h2&gt;
                          &lt;p&gt;&lt;?php echo $headDesc; ?&gt;&lt;/p&gt;
                          &lt;a href=&quot;playnow.php&quot; class=&quot;button scrolly&quot;&gt;&lt;?php echo $headPlay; ?&gt;&lt;/a&gt;
                      &lt;/div&gt;
                  &lt;/section&gt;
              &lt;?php } ?&gt;
  </code></pre>
  <p>Works perfectly fine.</p>
  <pre><code>&lt;div class=&quot;card&quot;&gt;
                               &lt;div class=&quot;card-horizontal&quot;&gt;
                                  &lt;div class=&quot;img-square-wrapper&quot;&gt;
                                      &lt;img class=&quot;&quot; src=&quot;http://via.placeholder.com/300x180&quot; alt=&quot;Card image cap&quot;&gt;
                                   &lt;/div&gt;
                              &lt;div class=&quot;card-body&quot;&gt;
                                  &lt;h4 class=&quot;card-title&quot;&gt;&lt;?php echo $cardTitleA; ?&gt;&lt;/h4&gt;
                                  &lt;p class=&quot;card-text&quot;&gt;&lt;?php echo $cardInfoA; ?&gt;&lt;/p&gt;
                              &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
  </code></pre>
  <p>This pushes out :</p>
  <blockquote>
  <p>[24-Apr-2021 22:48:21 UTC] PHP Notice:  Undefined variable: cardTitleA in /dev/index.php on line 38
  [24-Apr-2021 22:48:21 UTC] PHP Notice:  Undefined variable: cardInfoA in /dev/index.php on line 39</p>
  </blockquote>
  <p>Not sure why one is working but the others isnt.</p>
  <p>Database function :</p>
  <pre><code>function getDb($table, $column){
          
          $mysqli = new mysqli(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_DATABASE);
          
          $query = &quot;SELECT * FROM &quot;.$table;
          
          $result = $mysqli-&gt;query($query);
          
          foreach ($result as $row) {
              $final = $row[$column];
          }
          
          return $final;
          
      }
  </code></pre>