http://kah601.cafe24.com/loadBoard.php


이 주소로 들어가보시면 아시겠지만

"List":[{"num":"50","name":"","date":"2012-02-13","content":""}.......


db에 이런식으로 자동생성되는 num과 date값 제외한 나머지 name과 content에는 아무 내용이

들어가질않습니다 ㅠㅠ


load하는데는 전혀 문제가 없는데요 write할 때 안드로이드에서 name과 content 값이

웹디비에 넘어가지않는다는게 문제네요


write관련 php문 보여드릴게요


<?php
        $id = $_GET['id'];    	define("__ZBXE__", true);	include("../../files/config/db.config.php");	$connect = @mysql_connect(localhost, 아이디 , 비번 );    @mysql_select_db("kah601", $connect);    @mysql_query("set names utf8");

$sql = sprintf("INSERT INTO `test_ah` (`num`,`name`, `date`, `content`) VALUES ('%s','%s', '%s', '%s');",$num ,$name,date("Y-m-d H:i:s"),$content); 
$result = mysql_query($sql, $connect);
mysql_close();
?>


이런식으로 했거든요 처음에는 test_ah라는 테이블에 num은 기본키고 자동생성되기 때문에 

$sql = sprintf("INSERT INTO `test_ah` (`name`, `date`, `content`) VALUES ('%s', '%s', '%s');",$num ,$name,date("Y-m-d H:i:s"),$content); 


이런식으로 작성하였으나 혹시 컬럼값 하나를 빼놓아서 들어가질 않나 싶어 저렇게 해보았지만

깜깜 무소식이에요 ㅠㅠㅠ 


분명 핸드폰에서 버튼을 누르면 레코드는 생성이 되긴됩니다 하지만 name하고 content가

들어가지 않는다는게 문제네요 ㅠㅠㅠㅠ


코드부분도 보여드릴게요


HttpClient httpClient = new DefaultHttpClient();
    	HttpPost httppost = new HttpPost("http://kah601.cafe24.com/writeboard.php");
    	
    	try {
    	List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
    	Log.d("잘되나","1");
    	nameValuePairs.add(new BasicNameValuePair("num","NULL"));
    	nameValuePairs.add(new BasicNameValuePair("name",write_Name.getText().toString()));
    	Log.d("잘되나","2");
    	Log.d("잘되나",write_Name.getText().toString());
    	nameValuePairs.add(new BasicNameValuePair("content",write_Content.getText().toString()));
    	Log.d("잘되나",write_Content.getText().toString());
    	Log.d("잘되나","3");
    	httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs,HTTP.UTF_8));
    	Log.d("잘되나","4");
    	HttpResponse response = httpClient.execute(httppost);
    	Log.d("잘되나","5");
		
		HttpEntity entity = response.getEntity();
		entity.getContent();
		Log.d("잘되나","6");
    	} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
    		Log.d("잘되나","UnsupportedEncodingException");
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			Log.d("잘되나","IOException");
			e.printStackTrace();
		}


혹시 에디트텍스트에서 값이 안넘어가나 하고 로그도 찍어봤지만 문제가없었습니다 ㅠㅠㅠ

원래는 num값도 null넣어주는 작업을 안넣었었는데, 혹시 이것때문에 그런가하고 해봤지만

둘다 안되네요 ㅠㅠㅠㅠㅠ



어떤것이 잘못되었기에 저러는걸까요....

테이블 필드는 num, name, date, content 순이구요

num은 autoincrement형태, name은 VARCHAR(10), date는 DATE, content는  VARCHAR(50)

이런 형태입니다.


아시는분은 꼭 답변부탁드릴게요 (__)흑흑..