I have a simple table in MySQL
How can I do inserting data in web form.
I'm usind these codes but doesn't work.
<?php
if ($gonderim)
{
/ Connecting, selecting database /
mysql_connect("localhost", "root", "")
or die ("");
print " Baglanti Basarili ";
mysql_select_db("hastakayit") or die("");
print "";
/ Performing SQL query /
mysql_query("insert into kimlik
(Dosya_No, Hasta_Adi, Hasta_Soyadi, Dogum_Yeri, Dogum_Tarihi) values
(null,'$Hasta_Adi', '$Hasta_Soyadi', '$Dogum_Yeri', '$Dogum_Tarihi')");
if (mysql_error())
{
echo ("MySQL HATASI OLUSTU. HATA: ");
echo mysql_error();
}
$Dosya_No=mysql_insert_id();
echo ("<br> Hasta Dosya No: $Dosya_No");
}
else
{
?>
<form action="deneme3.php" method="post">
Hasta_Adi:<input type="text" name="Hasta_Adi" size="16" maxlength="16"><br>
Hasta_Soyadi:<input type="text" name="Hasta_Soyadi" size="16" maxlength="16"><br>
Dogum_Yeri:<input type="text" name="Dogum_Yeri" size="16" maxlength="16"><br>
Dogum_Tarihi:<input type="text" name="Dogum_Tarihi" size="16" maxlength="16"><br>
<input type="submit" name="gonderim" value="Gönder">
</form>
<?
}
?>