Advertisement
callmewhateverUwant

select data from database

May 29th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. <?php
  2. #SELECT data from table
  3. $sql = <<<SQL
  4.     SELECT id,userid,fullname,email,password
  5.     FROM `user`
  6.    
  7. SQL;
  8.  
  9. if(!$result = $db->query($sql)){
  10.     die('There was an error running the query [' . $db->error . ']');
  11. }
  12. while($row = $result->fetch_assoc()){
  13.     echo '<hr>';
  14.     echo @++$no;
  15.     echo '<hr>';
  16.     echo $row['email'] . '<br />';
  17.     echo $row['password'] . '<br />';
  18.     echo $row['userid'] . '<br />';
  19. }
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement