如何将Textview值放入URL以使用$ _GET从PHP接收

Forgive me for asking this, But im new in android development. So I'm trying to put the TextView value into my URL, that in my webservice(PHP) I have $_GET to test my query and show only the desired match value of field name "WHERE CODE_ID = .$sample."

CameraTestActivity.class

if (!scanText.getText().toString().matches("")){

    //set the scan text from bar code label
    scanText.setText(sym.getData());

     //if Text scan the Content Automatic go to another Activity and pass the scan text from Main Activity

    Intent i = new Intent(CameraTestActivity.this, MainActivity2.class);
    i.putExtra("code_id", content);
    startActivity(i);
    finish();
}

MainActivity2.class

//trying to put the TextValue of scanText into tvView
tvView = (TextView)findViewById(R.id.textView9);
tvView.setText(getIntent().getExtras().getString("code_id"));

String ServerURL = ("https://asec-domain.000webhostapp.com/select.php?code_id="  + tvView);

getAll.php

if (isset($_GET['code_id'])) 
{ 
  $id  = $_GET['code_id'];
}  

// Create connection

$conn = new mysqli($HOST='localhost', $USER='id4400742_asec_domain', $PASS='asec@l0cal', $DB='id4400742_tbl_data');

if ($conn->connect_error) {

 die("Connection failed: " . $conn->connect_error);
} 

$sql = "SELECT * FROM tbl_ComputerDetails WHERE CODE_ID= id "; 

$result = $conn->query($sql);

if ($result->num_rows >0) {

 while($row[] = $result->fetch_assoc()) {

 $tem = $row;

 $json = json_encode($tem);

 }

 echo $json;

 }

 else 
 {

 echo "No Results Found.";
 }
    $conn->close();
?>

You have to do it like this

If id is a number:

$sql = "SELECT * FROM tbl_ComputerDetails WHERE CODE_ID = ".$id; 

If id is a String

$sql = "SELECT * FROM tbl_ComputerDetails WHERE CODE_ID = '".$id."'";

Otherwise id is just the String "id" and not a number you retrieve from GET. And by the way this is not a good practice because of SQL Injection

And always hide your passwords and usernames when you post something

So in Android you are missing this:

//trying to put the TextValue of scanText into tvView
tvView = (TextView)findViewById(R.id.textView9);
tvView.setText(getIntent().getExtras().getString("code_id"));

//You are not getting the string you are just passing the textview
String result = getIntent().getExtras().getString("code_id");

String ServerURL = ("https://asec-domain.000webhostapp.com/select.php?code_id="  + result);