hi
       thanks,using this it is working properly

On Jul 10, 4:02 pm, Fabrice B <[EMAIL PROTECTED]> wrote:
> $c->addAscendingOrderByColumn('RAND()');
>
> without the quotes, rand() was executed in PHP. Your goal is to
> include it as a string in the SQL clause, so just put quotes aound it.
>
> Fabrice
>
> On Jul 10, 7:28 am, kusum <[EMAIL PROTECTED]> wrote:
>
> > hi,
> >      i have already used this
> > addAscendingOrderByColumn(rand()).
> > but rand() is not a defined column in any table ,so it is giving
> > error.
>
> > On Jul 9, 5:50 pm, Tom Haskins-Vaughan <[EMAIL PROTECTED]>
> > wrote:
>
> > > addAscendingOrderByColumn
> > >                     ^^^^^^
>
> > > kusum wrote:
> > > > hi all
> > > >          i want to select random records from listing table using this
> > > > format,becoz i want to use
> > > > some method of listing class.
>
> > > >           $c=new Criteria();
> > > >            $c->addJoin(BuilderProjectPeer::OWNER_ID, OwnerPeer::ID);
> > > >            $c->addJoin(ListingPeer::OWNER_ID,
> > > > BuilderProjectPeer::OWNER_ID);
> > > >            $c->setLimit(5);
> > > >            $c->addAscendingOrderBy(rand());//line 47
> > > >            $checkrecord = ListingPeer::doSelectJoinOwner($c);
>
> > > > It is giving error
>
> > > > Fatal error: Call to undefined method Criteria::addAscendingOrderBy()
> > > > in /home/kusum/workspace/zam_fe/apps/frontend/modules/home/actions/
> > > > actions.class.php on line 47
>
> > > > how i can set rand() in order by.
>
> > > > Using this query it is working properly.
>
> > > > $query2 = "SELECT listing.ID as listingid,listing.covered_area as
> > > > covered_area ,listing.BEDS as listingbed,listing.PRICE as
> > > > listingprice,listing.CITY as listing_city,listing.AREA as
> > > > listing_area,listing.PROPERTY_TYPE as listing_property_type ,
> > > > builder_property.name as propertyname,owner.logo_url as
> > > > logo,listing.photo_url as photo FROM
> > > > listing,builder_property,builder_project,owner WHERE
> > > > listing.OWNER_ID=owner.ID AND
> > > > builder_project.OWNER_ID=listing.OWNER_ID  AND
> > > > builder_project.OWNER_ID=listing.OWNER_ID ORDER BY rand() LIMIT 4";
> > > >        $conn = Propel::getConnection();
> > > >       $stmt = $conn->prepareStatement($query2);
> > > >      $this->listingbuilder =$stmt->executeQuery();
>
> > > --
> > > Tom Haskins-Vaughan
> > > Temple Street Media: Design and Development for the Web
> > > [EMAIL PROTECTED] |www.templestreetmedia.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to