PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTML » HTML_QuickForm » Bug #5705

using loadDBResult with DB_FETCHMODE_OBJECT

Details

Submitted2005-10-17 12:37 UTC
Fromm dot lindeman at pictura-dp dot nl
Assignedavb
StatusClosed
PackageHTML_QuickForm
PHP VersionIrrelevant
OSKubuntu linux
Roadmaps(Not assigned)

Comments

[2005-10-17 12:37 UTC] m dot lindeman at pictura-dp dot nl

Description:
------------
in method loadDBResult of class HTML_QuickForm_select there is no support for fetchmode DB_FETCHMODE_OBJECT when $textCol=null and $valueCol=null.

Test script:
---------------
<?php
$db = DB::Connect('mysql://user:passwd@host/dbname');
$db->setFetchMode(DB_FETCHMODE_OBJECT);
$rs = &$db->Query('SELECT COL1, COL2 FROM table');
$form = new HTML_QuickForm();
$select = &$form->createElement('select');
$select->loadDbResult($rs);
$form->display();
?>

Expected result:
----------------
<form ....>
<select>
<option value="row1__value">row1_text</option>
...
</select>
</form>

Actual result:
--------------
<form ....>
<select></select>
</form>