I think database operations isn't explained very well, on guide . I couldn't understand it. Because of this i have a question. I asked it Yii Forums but there isn't any answer. This is my socials table for example.
+------------+---------------------------+--------------+--------------+---------------+
| socials_ID | socials_link | socials_type | socials_user | socials_order |
+------------+---------------------------+--------------+--------------+---------------+
| 48 | link | 8 | 1 | 4 |
| 47 | blablabla | 11 | 1 | 3 |
| 301 | userlinkuse | 9 | 1 | 6 |
+------------+---------------------------+--------------+--------------+---------------+
I want to get all datas from this table which socials_user collumn equals to 1 . There can be a few rows (in this example there are 3 rows) .
What method should i use ? I'm trying this :
$allSocial = '';
$socials=Socials::model()->findByAttributes(array('socials_user'=>1));
foreach ($socials as $social)
{
$type = $social["socials_type"];
$allSocial .= $type . ",";
}
return $allSocial;
but this is returning 4 , l , 8 ,1 , 4 . (First letter / number of every collumn on first row)
How can i use it ? findByAttributes AR is adding LIMIT 1;
to SQL ?