<?php
$con = new Mysqli('localhost','root','sifre','databasename');
if (isset($_POST['dugme'])){
$ad=$_POST['ad'];
$sifre=$_POST['sifre'];
$sorgu="INSERT INTO uye(kullaniciadi,sifre) VALUES(?,?)";
$ekle=$con->prepare($sorgu);
$ekle->bind_param("ss",$ad,$sifre);
//Buradaki ss veritabanı değişkenlerinin türü olarak kullanılmaktadır. ( ss )
//Yani ikisininde string oldugunu belirtir.
$ekle->execute();
if ($ekle){
echo "BİLGİLER EKLENDİ";
}
else {
echo "BİLGİLER EKLENEMEDİ";
}
}
?>
Hiç yorum yok:
Yorum Gönder