View Single Post
  #2  
Old 01-19-2017, 05:14 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 19,370
IntoRain is on a distinguished road
Default

The array you use inside a db->select() is the array with the names of the columns that have the information you want to retrieve. What array_unique does is to remove duplicates from that array. So you can't use array_unique inside a db->select for what you want to do.

The usual database functionality that does what you want is Select Distinct, however I don't know how to do that with mysidia's database calls without creating a new database function. So I guess the easiest way is like this:

PHP Code:
$array $mysidia->db->select("owned_adoptables", array("type"), "owner = '{$mysidia->user->username}'")->fetchAll(PDO::FETCH_UNIQUE);
$owned1 count($array); 
__________________


asp.net stole my soul.
Reply With Quote