Question: I did a lot of research before I post this question, but still cant figure out why I can't print a simple php value. My issue is that I'm trying to assign a value to an id, basically I want to assign the id that comes back from DataBase to button id. I'm able to print the values of id, name, email, but I can't assign the id as a value. 

Can anyone tell me what is wrong with this line of code please?

```
$table .= '<td><button id = "<?php echo $row[\'id\']; ?>" onclick = "editUser()">Edit</button></td>';

```

Here's my PHP code which simply pulls data from database and display them on the page using Ajax.

```
<?php
require "conexion.php";

$name =$_GET["nombre"];

if($name === "showPeople"){
$client = mysqli_real_escape_string($con, $name);
$result = mysqli_query($con,"SELECT * FROM people");

$table .= '<table>';
while($row = mysqli_fetch_assoc($result))
{
    $table .= '<tr>';
    $table .= '<td>' .$row['id'] . '</td>';
    $table .= '<td>' .$row['name'] . '</td>';
    $table .= '<td>' .$row['email'] . '</td>';
    $table .= '<td><button id = "<?php echo $row[\'id\']; ?>" onclick = "editUser()">Edit</button></td>';
    $table .= '</tr>';
}
$table .= '</table>';

echo $table;
}
?>

```

Answer: 
You can't put `<?php` and `?>` inside of strings and then print them to execute their contents. Try this instead:

```
$table .= '<td><button id="' .$row['id'] . '" onclick="editUser()">Edit</button></td>';

```
instead of line

```
$table .= '<td><button id = "<?php echo $row[\'id\']; ?>" onclick = "editUser()">Edit</button></td>';

```

Try 

```
$table .= '<td><button id = "' .  $row['id'] . '" onclick = "editUser()">Edit</button></td>';

```