Note that there are some explanatory texts on larger screens.

plurals
  1. POmy dropdown displays only one first alphabet of the data from the database
    primarykey
    data
    text
    <p>i am trying to code in codeigniter using mysql database and using the html tags...now when i try to retrieve the data of the database to the dropdown it only displays the first alphabet.I am using the following code in <b> VIEW </b></p> <pre><code>&lt;select name="country" style="width: 200px;"&gt; &lt;?php foreach($countries as $country) { echo '&lt;option value="'.$country['PKCOUNTRY'].'"&gt;'.$country['COUNTRYNAME'].'&lt;/option&gt;'; } ?&gt; &lt;/select&gt; </code></pre> <p><b> MODEL </b></p> <pre><code>&lt;?php </code></pre> <p>class Countries_model extends CI_Model {</p> <p>public function __construct() {</p> <pre><code> parent::__construct(); } </code></pre> <p>public function get_countries() {</p> <pre><code> $query = $this-&gt;db-&gt;get('ISaathiDev.MCountry'); if ($query-&gt;num_rows &gt;= 0) { foreach($query-&gt;result_array() as $row) { $data[$row['pkCountry']]=$row['CountryName']; } return $data; } } </code></pre> <p>} ?></p> <p><b> CONTROLLER </b></p> <pre><code>&lt;?php </code></pre> <p>class countries extends CI_Controller {</p> <pre><code>public function __construct() { parent::__construct(); $this-&gt;load-&gt;model('Countries_model'); } public function hey() { } public function country() { //$this-&gt;load-&gt;view('u_view'); //log_message('debug', 'hey :Construct'); //$this-&gt;load-&gt;view('u_view'); $this-&gt;load-&gt;database(); $data['countries']=$this-&gt;Countries_model-&gt;get_countries(); $this-&gt;load-&gt;view('countries_view',$data); } </code></pre> <p>}</p> <p>?></p> <p><img src="https://i.stack.imgur.com/2X97r.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload