Here's a snippet, which allows you to select only one column in a query, and access to the result in symfony.

<?php
$c
= new Criteria();
$c->clearSelectColumns();
$c->addSelectColumn(objectPeer::COUNTRY);
$c->setDistinct();
$res = objectPeer::doSelectStmt($c);
while (
$row = $res->fetch()) {
 
$country = $row[0];
}
?>

Works with Propel 1.4 and symfony 1.3/1.4.

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.