*

marcam

  • ****
  • 267
onlineuser.php
« on: February 06, 2013, 05:50:18 PM »
Hi; i work's on new systeme for display onlineuser by contry ect ect
but i need litle help with section of code .

$sql = 'SELECT  SQL_CALC_FOUND_ROWS distinct  *, floor((to_days(curdate())-to_days(birth_date))/365.25)  as age
 FROM ! WHERE status in (?,?) AND country = ? AND state_province = ?   ';
 
 $data = $osDB->getAll( $sql.' order by pictures_cnt DESC limit '.$start.','.$psize, array(
 USER_TABLE,  get_lang('status_enum','active'), 'active', 'FR', '03') );

the '03' is for diplay by state_province but if i want display 2 state_province  how make the code ?

any suggestion please ?


osdate 2.5.4
Flashchat 4.7
php 5.2.7

*

CBG

  • *****
  • 673
    • osDate Forum
Re: onlineuser.php
« Reply #1 on: February 07, 2013, 07:14:58 PM »
In the database state_province only has answer, so output just the one.
Where is the other answer for state_province coming from?
Regards,
CBG (Garry)
osDate: 2.6.5, 2.7 & Evo
PHP: 5.5.x/5.6.x (5.3.x to 5.6.x) | MySQL: 5.5.34-cll

*

marcam

  • ****
  • 267
Re: onlineuser.php
« Reply #2 on: February 07, 2013, 07:40:04 PM »
i have try that
$sql = 'SELECT  SQL_CALC_FOUND_ROWS distinct  *, floor((to_days(curdate())-to_days(birth_date))/365.25)  as age
 FROM ! WHERE status in (?,?) AND country = ? AND state_province = ?  AND state_province = ?  ';
 
 $data = $osDB->getAll( $sql.' order by pictures_cnt DESC limit '.$start.','.$psize, array(
 USER_TABLE,  get_lang('status_enum','active'), 'active', 'FR', '03', '04') );
 
but not display !!

Marc


In the database state_province only has answer, so output just the one.
Where is the other answer for state_province coming from?
osdate 2.5.4
Flashchat 4.7
php 5.2.7

*

marcam

  • ****
  • 267
Re: onlineuser.php
« Reply #3 on: February 09, 2013, 02:05:26 PM »
any idea ? 
osdate 2.5.4
Flashchat 4.7
php 5.2.7