전 페이지(Tabs1)에서 DB에 들어있는 값을 텍스트 뷰로 출력시키고 나서 다음 페이지(IntroTeam)로
인텐트를 이용해 값을 넘겼습니다.
Intent intent = new Intent(mContext, IntroTeam.class);
inent.putExtra("name", text01.getText01().toString());
startActivitiy(intent);
다음 페이지(IntroTeam)에서 넘겨 받은 값을 변수(msg)에 저장해서 텍스트뷰로 출력했습니다.
Intent intent = getIntent();
msg = inent.getStringExtra("name");
TextView text001 = (TextView) findViewById(R.id.text001);
text001.setText(msg);
그리고 sqlite select 쿼리문을 이용해서 DB의 컬럼값과 변수(msg)를 비교하려고 하는데 잘 안되네요...
분명히 변수(msg)에 넘겨받은 값이 저장되어있는데도 오류가 납니다.
String sql = "select id, name, hometown, coach, award, record from " + tablename + " where name = 'msg'";
위와 같이 커리문을 쓰니 오류가 납니다. name 값과 msg 값을 비교해야 되는데 안되네요.
String sql = "select id, name, hometown, coach, award, record from" + tablename + " where name = '경남'";
위와 같이 커리문을 쓰면 됩니다.
DB값과 변수를 비교하려면 쿼리문을 어떻게 사용해야 할지 가르쳐주세요...