I've an SQL query as follows:
SELECT test_user_user_id FROM OCN.tests_users WHERE test_user_test_id = 99
$this->mDb->Query( $sql );
$students_data = $this->mDb->FetchArray();
I get the array as follows:
Array
(
[0] => Array
(
[test_user_user_id] => b9e6493f9f8599bc5a0a5935275228c2
)
[1] => Array
(
[test_user_user_id] => 395599c5891c1418357e2efa89bc3e27
)
[2] => Array
(
[test_user_user_id] => 3255605bb9fd3ecc0295a1bfb3cba147
)
[3] => Array
(
[test_user_user_id] => ebe6711fc156b2cc1a33f64f3d86150f
)
[4] => Array
(
[test_user_user_id] => 627b9c3f21d93f1e13af076cff20b143
)
[5] => Array
(
[test_user_user_id] => 030e96561c01afde1c46384f57cf8749
)
[6] => Array
(
[test_user_user_id] => 9def02e6337b888d6dbe5617a172c18d
)
)
Actually I want the array in following format:
Array
(
[0] => b9e6493f9f8599bc5a0a5935275228c2
[1] => 395599c5891c1418357e2efa89bc3e27
[2] => 3255605bb9fd3ecc0295a1bfb3cba147
[3] => ebe6711fc156b2cc1a33f64f3d86150f
[4] => 627b9c3f21d93f1e13af076cff20b143
[5] => 030e96561c01afde1c46384f57cf8749
[6] => 9def02e6337b888d6dbe5617a172c18d
)
How to get the array in above format?
$resArray = Array();
foreach($myArr as $_arr)
{
$resArray[] = $_arr['test_user_user_id'];
}
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments