1
Mazar
How can i get global userid in admin section of my module to query the database
  • 2009/8/24 13:03

  • Mazar

  • Not too shy to talk

  • Posts: 191

  • Since: 2009/1/4 0


$criteria = new CriteriaCompo();
I want to to be able to get the uid of loged in person something like
uid 
in the database field userid.
$criteria->renderWhere('uid','userid');
$criteria->setSort("date");
$criteria->setOrder("ASC");
$numrows $bookingsHandler->getCount();
$bookings_arr $bookingsHandler->getall($criteria);

2
ghia
Re: How can i get global userid in admin section of my module to query the database
  • 2009/8/24 13:09

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


$uid 0;
if (
is_object($xoopsUser
{
  
$uid =xoopsUser->getVar('uid');
}

I doubt your renderWhere arguments are correct.

3
Mazar
Re: How can i get global userid in admin section of my module to query the database
  • 2009/8/24 13:26

  • Mazar

  • Not too shy to talk

  • Posts: 191

  • Since: 2009/1/4 0


I can get the userid now. yeah i guess this renderwhere not working
I tried other method saw in a post by trabis but that also not seems to be getting the rows from table

$criteria = new CriteriaCompo(new Criteria('userid'$uid));
        
$criteria->setSort("date");
        
$criteria->setOrder("ASC");
        
$numrows $bookingsHandler->getCount();
        
$bookings_arr $bookingsHandler->getall($criteria);

4
Mazar
Re: How can i get global userid in admin section of my module to query the database
  • 2009/8/24 13:30

  • Mazar

  • Not too shy to talk

  • Posts: 191

  • Since: 2009/1/4 0


thanks solved it, i had a wrong column name in my criteria.

Login

Who's Online

204 user(s) are online (32 user(s) are browsing Support Forums)


Members: 0


Guests: 204


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits