Hello, i from Czech Republic, my language is bad.
So i have problem with: Reading the problem and save the id of the database
here is my code:
if ($submit)
{
$connect = mysql_connect ("$localhost","$user","$pass") or die("Nepodařilo se připojit k databázi");
mysql_select_db ("databaze");
$vysledekSql = mysql_query("SELECT id, uzivatelskejmeno, heslo FROM klienti WHERE uzivatelskejmeno = '".$name."' AND heslo = '".$password."' ;");
echo $vysledekSql;
if ($radek = mysql_fetch_assoc($vysledekSql))
{
$_SESSION["id"]=$radek['id'];
$id=$_SESSION["id"]=$radek['id'];
}
$queryreg = mysql_query("
INSERT INTO inzeraty VALUES ('$id','','','$nadpis','$text','$date')
");
}
?>
How to fix it to my database of "inzeraty" imposing an ID from the database "klienti"? "
Thank you