rishe
-
Posts
3 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by rishe
-
-
i have tried with implode() function, but i am getting error as "Warning: implode(): Invalid arguments".
My code is
$dept= "ATM";
$sql = "SELECT `layer1`,`layer2`,`layer3` FROM `dept_desc` where `departments` = '$dept'";
//Run the query$result = mysql_query($sql);if (! $result){throw new My_Db_Exception('Database error: ' . mysql_error());}while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {$layers="['{$row['layer1']}' ,"."'{$row['layer2']}', "."'{$row['layer3']}' ]"."<br>";} -
i am fetching data from database. and storing that data in the array.
the result is
Array ( [0] => Array ( [workspace] => cite [layer1] => layer [layer2] => atm layer1 [layer3] => atm layer2 ) )
how to convert the above array as string.
so that the result should be like this cite,layer , atm layer1 ,atm layer2
my code is
$dept= "ATM";
//Create the query$sql = "SELECT `workspace`,`layer1`,`layer2`,`layer3` FROM `dept_desc` where `departments` = '$dept'";//Run the query$result = mysql_query($sql);if (! $result){throw new My_Db_Exception('Database error: ' . mysql_error());}$arr = array();while($row = mysql_fetch_assoc($result)){$arr[] = $row;}print_r ($arr);
looping arraylist
in PHP
Posted
hi all,
i am fetching the data from database in array as
print_r($latlon);