php - Warning: Invalid argument supplied for foreach() / Mysql -


i have got problem php code.

i trying write code, should find informations of email example wich mike@mike.com".

if im running code, im getting error:

warning: invalid argument supplied foreach() ....... 

here code:

<?php $pdo = new pdo('mysql:host=localhost;dbname=test', 'test', 'test');  $db = "select * request email = mike@mike.com ";   foreach ($pdo->query($db) $row) {     echo $row['firstname']." ".$row['lastname']."<br />";    echo "e-mail: ".$row['email']."<br /><br />"; } ?> 

what doing wrong? :(


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -