php - PDO MYSQL Why not working? -


i don't have idea why not working ? :)

this returns 0;

$stmt3=$db->query('select count(*) "ilosc" plat_user `imie`="'.$_post['imie'].'" , `nazwisko`="'.$_post['nazwisko'].'" , `nip`="'.$_post['nip'].'" , `email`="'.$_post['email'].'" , `grupa`=1'); $stmt3->execute(); $row3 = $stmt3->fetch(); echo $row3['ilosc'];  

this code works , (return 1):

$rowy = mysql_num_rows(mysql_query('select count(*) "ilosc" plat_user `imie`="'.$_post['imie'].'" , `nazwisko`="'.$_post['nazwisko'].'" , `nip`="'.$_post['nip'].'" , `email`="'.$_post['email'].'" , `grupa`=1')); 

generated query in phpmyadmin return 1 dont know why pdo return 0

just try it:

$stmt3=$db->query('select count(*) "ilosc" plat_user `imie`="'.$_post['imie'].'" , `nazwisko`="'.$_post['nazwisko'].'" , `nip`="'.$_post['nip'].'" , `email`="'.$_post['email'].'" , `grupa`=1'); $stmt3->execute(); $row3 = $stmt3->fetch(pdo::fetch_assoc); // changes here echo $row3['ilosc'];  

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -