Advertisement
Guest User

query Pdo

a guest
Apr 18th, 2018
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. $sql = 'SELECT name, color, calories FROM fruit ORDER BY name';
  2. foreach ($conn->query($sql) as $row) {
  3. print $row['name'] . "\t";
  4. print $row['color'] . "\t";
  5. print $row['calories'] . "\n";
  6. }
  7. /* ahora $row tiene mi consulta realizada por lo tanto para acceder a la consulta hago mediante el $row*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement