| [resolved] doSelectRS problem [message #9234] |
Sun, 23 July 2006 18:11  |
seb.b Messages: 37 Registered: July 2006 |
Member |
|
|
Hello,
I've got a problem with the doSelectRS function, I never go in the while instruction. However, when I execute the request in phpmyadmin (I take the request in the log file) I've some results.
I don't see what is not good in my code...
$c=new Criteria();
$c->add(DepartementPeer::ID_REGION,'54');
$c->clearSelectColumns();
$c->addSelectColumn(DepartementPeer::ID_DEPARTEMENT);
$c->addSelectColumn(DepartementPeer::DEP_NOM);;
$rs = DepartementPeer::doSelectRS($c);
$liste = "";
while ($rs->next) {
sfContext::getInstance()->getLogger()->info("boucle");
$liste =$liste."<option value=\"".$rs->getString(1)."\">".$rs->getString(2)."</option >";
}
Any idea?
Thx
[Updated on: Mon, 24 July 2006 14:35] by Moderator
|
|
|
|
|
|
|
| Re: doSelectRS problem [message #9294 is a reply to message #9293 ] |
Mon, 24 July 2006 19:55  |
chtito Messages: 512 Registered: March 2006 Location: Sweden |
Faithful Member |
|
|
I think that it is perfectly all right to use doSelectRS instead of doSelect. It is even recommended in the propel doc in case of big result sets, as seems to be your case.
However i think that you should use options_for_select to build your menu since the use of html code is in principle restricted to templates and helpers.
|
|
|