I don't know what is happening, but if I haven't any row in my php while to show jquery click will not work.
If I have one or more rows in WHILE jquery works. If I remove the while part of php, it works.
php:
$stmt = $mysqli_link->prepare("select id, user from posts limit 10");
$stmt->execute();
$stmt->bind_result($id, $user);
$i=0;
while($stmt->fetch()) { //if nothing to show JQUERY will not work
$i=$i+1;
show_p($id, $user);
}
$stmt->close();
jquery
$(document).ready(function(){
$(".changesize").click(function(e){
alert("ok");
});
});
what is the problem with while and jquery? any ideas?
EDIT----------------------- my temporary solution:
$stmt->store_result();
$num = $stmt->num_rows; //NUM ROWS
if($num>0){ //if more than 0 rows. call while
$i=0;
while($stmt->fetch()) {
...
`
– RGS Feb 17 '16 at 14:12