How do I assign the retrieved value to hidden field
<?php
$email = $_POST["email"];
$db = mysql_connect("localhost", "root");
mysql_select_db("visitor",$db);
$sql = "INSERT INTO invoice (email) VALUES ('$email')";
$result = mysql_query($sql);
$last_id = mysql_insert_id();
echo "Thank you! Information entered.\n";
//This displays perfectly
echo $last_id;
//This is giving problems
echo '<input name="lastid" type="hidden" id="lastid" value="$last_id">';
?>