Expand|Select|Wrap|Line Numbers
- <?php
- //phpinfo();
- include_once('json/JSON.php');
- $json = new Services_JSON();
- $con = mysql_connect("localhost","clas_installer","installerpass");
- if (!$con)
- {
- die('Could not connect: ' . mysql_error());
- }
- $selected = mysql_select_db("clas_registration",$con)
- or die("Could not select registration");
- $arr = array();
- $rs = mysql_query("SELECT county FROM cities_counties WHERE stateabbreviation='AL' ORDER BY county");
- while($obj = mysql_fetch_object($rs)) {
- $arr[] = $obj;
- }
- echo (mysql_error());
- echo $json->encode($arr)
- ?>