function kullaniciKontrol($email, $sifre )
{
$db=new PDO("mysql:host=localhost;dbname=domain;charset=utf8","root","");
$smtp = $db->prepare("select * from kullanicilar where email=? and sifre=?");
$smtp->execute(array($email, $sifre));
return $bilgi = $smtp->fetch(PDO::FETCH_ASSOC);
}
$s=kullaniciKontrol("ramazan@kacmaz.org","123");
echo '';
echo print_r($s);
echo '
';
burda sonuclar bu şekilde geliyor
Array
(
[kId] => 1
[ad] => Ramazan
[email] => ramazan@kacmaz.org
[sifre] => 123
[resim] =>
)
1
ama ben bunları döngüyle alamıyorum
foreach ($s as $key => $value) {
echo $value["ad"];
}
Illegal string offset 'ad' in hatası veriyor