0
How do I insert the ID of a table into another table?
<?php
$login_cookie = $_COOKIE['login'];
if (!isset($login_cookie)) {
header("Location: index.php");
}
$con = mysqli_connect('localhost', 'root', '', 'lista');
$paginas = $_POST["paginas"];
$ins = "INSERT INTO paginas (paginas, usuario) VALUES ('".$paginas."','".$login_cookie."')";
if(mysqli_query($con, $ins)) {
echo "Registrado com sucesso!";
} else {
echo "Erro ao registrar!";
}
mysqli_close($con);
?>
You want to get the ID after the INSERT, right? This should resolve https://answall.com/questions/89986/pega-o-id-da-last-entered lintel no-data
– Guilherme Nascimento