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
Post a Comment