Skip to main content
Stéphane Quantin

Main navigation

  • Portfolio
  • About
  • Freelance Drupal
    • Audit de site Drupal
    • Drupal maintenance contract
  • Blog
  • CV
  • Contact
Languages
  • French
  • English

Breadcrumb

  1. Home
  2. Blog

Select a custom column with Propel in Symfony 1.4

Here's a snippet, which allows you to select only one column in a query, and access to the result in symfony.
$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.

Tags

  • PHP
  • Symfony
  • Propel

Social networks

  • Malt
  • codeur.com
  • 404Works
  • LinkedIn
  • Twitter
  • DoYouBuzz

Tweets by StephaneQ

RSS feed

Pied de page

  • Contact
  • Mentions légales
Powered by Drupal