Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once('db_connect.php');
- $inArray = false;
- $sql = "SELECT name FROM areas ORDER BY name ASC";
- $result = mysql_query($sql,$con) or die(mysql_error());
- $string = '[';
- while($ausgabe = mysql_fetch_array($result)){
- $string .= '\''.$ausgabe['name'].'\',';
- $inArray = true;
- }
- if($inArray){
- $string = substr($string, 0, -1);
- }
- $string .= ']';
- echo $string;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement