Because you have to select more than only the ID I changed the select statement to
$sql = "SELECT ID, fieldname4usersname, fieldname4email FROM $Table WHERE Name='" . addslashes($_POST['Name']) . "' AND Password='" . md5($_POST['Password']).'";
Nobody here knows the real names of the SQL fields. Therefore I wrote ...
fieldname4usersname, fieldname4email
You have to alter these names, so that they fit to your sql definitions.
And now tell me your problem. You have my print commands and your setcookie(). The solution depends on your conceptions.
One possibility is:
setcookie("LoggedIn", "ID:$row[ID] fieldname4usersname:$row[fieldname4usersname] fieldname4email:$row[fieldname4email]", time()+(3600 * 24));
But there exists a lot of other possibilities to populate the content of your cookie.