title: Fetching values from database and storing in variable
body: <p>I want to get database column values in some variable.
  I dont want to use </p>
  
  <pre><code>mysql_fetch_assoc
  mysql_fetch_row
  mysql_fetch_array
  mysql_fetch_object
  </code></pre>
  
  <p>anyone of this.</p>
  
  <p>My table is:</p>
  
  <pre><code>+----------+-----------+
  | ind_type | Index_val |
  +----------+-----------+
  | pcount   |       157 |
  | ncount   |       210 |
  +----------+-----------+
  </code></pre>
  
  <p>I want to get 157, 210 in some variable <code>$x</code> and <code>$y</code>.
  I am working in PHP.
  <strong>Can some one guide me.</strong>?</p>
  
  <p>One can do <code>$p= $mysqli-&gt;query('SELECT Index_val FROM view_name where ind_type=pcount');</code> and then iterate through all rows to fetch all values.</p>
  
  <p>But I have only two rows and for my need I want to manually fetch the values of <code>Index_val</code>. IF someone can sort it out!</p>