php ile mysql’e veri kaydı
<!– /* Font Definitions */ @font-face {font-family:”Cambria Math”; panose-1:2 4 5 3 5 4 6 3 2 4; mso-font-charset:162; mso-generic-font-family:roman; mso-font-pitch:variable; mso-font-signature:-1610611985 1107304683 0 0 415 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-unhide:no; mso-style-qformat:yes; mso-style-parent:””; margin:0cm; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:”Times New Roman”,”serif”; mso-fareast-font-family:”Times New Roman”; mso-fareast-language:EN-US;} .MsoChpDefault {mso-style-type:export-only; mso-default-props:yes; font-size:10.0pt; mso-ansi-font-size:10.0pt; mso-bidi-font-size:10.0pt;} @page Section1 {size:612.0pt 792.0pt; margin:70.85pt 70.85pt 70.85pt 70.85pt; mso-header-margin:35.4pt; mso-footer-margin:35.4pt; mso-paper-source:0;} div.Section1 {page:Section1;} –> MySql de alanları oluşturup php kodları ile veritabanına bağlanıyoruz
<?
if ($gorev==”kayit”) { $sorgu=@mysql_query(“select * from kulanici where kullaniciadi=\”$k_adi\” or email=\”$email\””);
$toplam=mysql_num_rows($sorgu);
$kvarmi=mysql_result($sorgu,0,”kullaniciadi”);
$kemail=mysql_result($sorgu,0,”email”);
if($toplam){
if($kvarmi){echo “Bu kullanıcı daha once kayıt edilmis.<br>”;}
if($kemail){echo “Bu email daha once kayıt edilmis.”;}
}else{
$sorgu=”insert into kulanici (kullaniciadi,sifre,ad,soyad,email,ilce,il) values (‘$k_adi’,’$sifre’,’$adi’,’$soyadi’,’$email’,’$ilce’,’$il’)”;
mysql_db_query($database,$sorgu,$baglan);echo “Kullanıcı kaydı başarılı bir şekilde yapıldı..”;} } ?>
<form method=”post” action=”index.php?gorev=kayit”>
</form>
