php - Count rows in while loop -


i trying while loop information select statement, count results. have tried @ least 10 different "solutions" , none works. 0, 1, or nothing. here's recent attempt:

$query35 = "select * movies userid = $memberid"; $result35 = $db->query($query35);  while ($row35 = $result35->fetchall(pdo::fetch_assoc)) {      $movie = $row35['movie'];      $query36 = "select count(*) similar movies userid = '$profileid' && movie = '$movie'";     $result36 = $db->query($query36);     $row36->fetchobject;      $similar = $row36['similar'];      echo $similar;  } 

$row36->fetchobject; 

seems null object, think should be

$row36 = $result36->fetchobject(); 

Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -