Note that there are some explanatory texts on larger screens.

plurals
  1. PO"Array" is displaying in dropdown instead of values fetched from database
    text
    copied!<p>code snippet from html_form_class</p> <pre><code>&lt;?php $frmStr = $frm-&gt;addSelectList( 'city', $city, true, '', '--- Select City ---', array( 'class' =&gt; 'dropdown-style5', 'id' =&gt; 'city')); echo $frmStr; ?&gt; </code></pre> <p>code snippet from seachcar.php</p> <pre><code> $city = $db-&gt;select('City','City_Name'); foreach($city as $row) { $row; } </code></pre> <p>"Array" is displaying in dropdown instead of values fetched from database Please Advice!</p> <pre><code>function addSelectList($name, $option_list, $bVal = true, $selected_value = NULL, $header = NULL, $attr_ar = array() ) { $str = "&lt;select name=\"$name\""; if ($attr_ar) { $str .= $this-&gt;addAttributes( $attr_ar ); } $str .= "&gt;\n"; if ( isset($header) ) { $str .= " &lt;option value=\"\"&gt;$header&lt;/option&gt;\n"; } foreach ( $option_list as $val =&gt; $text ) { $str .= $bVal? " &lt;option value=\"$val\"": " &lt;option"; if ( isset($selected_value) &amp;&amp; ( $selected_value === $val || $selected_value === $text) ) { $str .= $this-&gt;xhtml? ' selected="selected"': ' selected'; } $str .= "&gt;$text&lt;/option&gt;\n"; } $str .= "&lt;/select&gt;"; return $str; } </code></pre> <p>html output of addSelectList function is</p> <pre><code> &lt;select name="city" class="dropdown-style5" id="city"&gt; &lt;option value=""&gt;--- Select City ---&lt;/option&gt; &lt;option value="0"&gt;Array&lt;/option&gt; &lt;option value="1"&gt;Array&lt;/option&gt; &lt;option value="2"&gt;Array&lt;/option&gt; &lt;option value="3"&gt;Array&lt;/option&gt; </code></pre>
 

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