마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

정말어이없는질문하나드릴게요..ㅠㅠ한글비교!

0 추천

안녕하세요 안드로이드 초보개발자입니다..

php로 db구축햇구요

<? include "../../../gbid/gbidindex.php"; ?>
<?

 if(!$db) echo "Error01";
 else{
 
  $strText = json_decode(stripslashes($_REQUEST['params'])); 
  
  $board_content = $strText->board_content;
  $board_imgpath = $strText->board_imgpath;
  $board_type = $strText->board_type;
  $membership_idx = $strText->membership_idx;


  $sql = "INSERT INTO dog_board ( `board_idx` , `board_content` , `board_imgpath`, `board_date`,`board_type`,`membership_idx`) ".
       "VALUES ( null , '$board_content' , '$board_imgpath', now(),'$board_type','$membership_idx')";

  $rs = mysql_query($sql,$conn);

  if($rs) {
   echo "diaryinsert";
  }else{
   echo "fail";
  }

  mysql_close($conn);
 }
?>

이런식으로 db구축햇습니다. 그리고 db에 값은 한글로 잘 저장되구요

echo "diaryinsert"도 안드로이드 이클립스 log로 찍어보면 잘나옵니다.............

그런데!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 

List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
   nameValuePairs.add(new BasicNameValuePair("params", params.toString()));
//   httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs,"UTF-8"));
   httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs,HTTP.UTF_8));
   
   HttpResponse response = httpclient.execute(httppost);
   HttpEntity entity = response.getEntity();
   
   if(entity != null){
    String res = EntityUtils.toString(entity,HTTP.UTF_8);
    
    Log.d("--", "res = "  + res);
    if(res.equals("diaryinsert")){
     Log.d("--", "in");
    }    
//    Message msg = mhandler.obtainMessage();
//    msg.obj = res;
//    mhandler.sendMessage(msg);
   }

저기.. if(res.equlas("diaryinsert") 보이시나요................

저길로 들어가질않아요 ㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠ

미치겟어요 ㅠㅠ 그위에 log.d("--",res); 여긴 잘찍히거든요..

근데 왜 if문안으로 안들어가는걸까요.. ㅠㅠㅠㅠㅠㅠㅠㅠㅠ

정말미치겟네여 ㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠㅠ도와주세요 제발 고수님..ㅜ.ㅜ.ㅜ.ㅜ.ㅜ

 

 

로그뺏을경우!!

 

 

그냥 찍엇을경우!!!!!!!

 

mamongs (4,050 포인트) 님이 2013년 5월 27일 질문
mamongs님이 2013년 5월 27일 수정

2개의 답변

0 추천
res 가 diaryinsert로 찍히고 있나요?

다른 값이지 않을까 싶은데요
비뢰광 (7,180 포인트) 님이 2013년 5월 27일 답변
네..diaryinsert로 찍히고 있습니다 ㅠㅠㅠㅠㅠㅠ
그래서 미칠지경이에요 ㅠㅠ
앞에

Log.d("--", "res = " +res);
빼보고 로그 찍어보셨나요?

한번 해보시고 로그 찍은거 한번 올려주세요...
Log.d 빼보고 로그 찍어 달라고 하신말씀이 무슨말씀인지 잘..ㅠㅠ
제가 초보라 이해가 잘안가네요 ㅜㅜ 어떤방식으로 로그를 찍어달라고 하시는건지..ㅜㅜㅜㅜ
의미 그대로 인데요..
Log.d("--", "res = " +res);   를 주석하시거나 빼서 확인 해보시고
그래도 안되면  log.d  결과값    logcat에 나오잖아요?  그거 캡쳐나 복사해서 알려주시면 되세요...
글이 수정이 안되서 글을 다시 써보겠습니다
스크린 샷 찍엇어요 ㅜㅜ
0 추천

Log.d("--", "res = "  + res + "--");

해보세요..

혹시 res 뒤에 공백이 들어 있지는 않은지 확인하기 위해서...

isul (7,920 포인트) 님이 2013년 5월 27일 답변
뒤에 공백이 있었네요 ^^ 해결했습니다!!
관심감사합니다 ^^
...