Conecar no Mysql erro :

Estou seguindo um tutorial da net, para conectar no banco mysql mas nao funciona alguém ja fez isso ?

1. CREATE TABLE `people` ( 2. `id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY , 3. `name` VARCHAR( 100 ) NOT NULL , 4. `sex` BOOL NOT NULL DEFAULT '1', 5. `birthyear` INT NOT NULL 6. )

[code] 1.
<?php
2.
mysql_connect("host","username","password");
3.
mysql_select_db("PeopleData");
4.

  1. $q=mysql_query(“SELECT * FROM people WHERE birthyear>’”.$_REQUEST[‘year’]."’");

  2. while($e=mysql_fetch_assoc($q))

  3.     $output[]=$e;
    
  4. print(json_encode($output));

  5. mysql_close();

  6. ?>
    [/code]

[code] 1.
String result = “”;
2.
//the year data to send
3.
ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
4.
nameValuePairs.add(new BasicNameValuePair(“year”,“1980”));
5.

  1. //http post

  2. try{

  3.     HttpClient httpclient = new DefaultHttpClient();
    
  4.     HttpPost httppost = new HttpPost("http://example.com/getAllPeopleBornAfter.php");
    
  5.     httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
    
  6.     HttpResponse response = httpclient.execute(httppost);
    
  7.     HttpEntity entity = response.getEntity();
    
  8.     InputStream is = entity.getContent();
    
  9. }catch(Exception e){

  10.     Log.e("log_tag", "Error in http connection "+e.toString());
    
  11. }

  12. //convert response to string

  13. try{

  14.     BufferedReader reader = new BufferedReader(new InputStreamReader(is,"iso-8859-1"),8);
    
  15.     StringBuilder sb = new StringBuilder();
    
  16.     String line = null;
    
  17.     while ((line = reader.readLine()) != null) {
    
  18.             sb.append(line + "\n");
    
  19.     }
    
  20.     is.close();
    
  21.     result=sb.toString();
    
  22. }catch(Exception e){

  23.     Log.e("log_tag", "Error converting result "+e.toString());
    
  24. }

  25. //parse json data

  26. try{

  27.     JSONArray jArray = new JSONArray(result);
    
  28.     for(int i=0;i&lt;jArray.length();i++){
    
  29.             JSONObject json_data = jArray.getJSONObject(i);
    
  30.             Log.i("log_tag","id: "+json_data.getInt("id")+
    
  31.                     ", name: "+json_data.getString("name")+
    
  32.                     ", sex: "+json_data.getInt("sex")+
    
  33.                     ", birthyear: "+json_data.getInt("birthyear")
    
  34.             );
    
  35.     }
    
  36. }

  37. }catch(JSONException e){

  38.     Log.e("log_tag", "Error parsing data "+e.toString());
    
  39. }
    [/code]>