Guest User

Untitled

a guest
Dec 31st, 2018
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. $SQLhost='sub.domain.net';
  2. $SQLuser='user';
  3. $SQLpass='password';
  4. $SQLdbase='DBase';
  5.  
  6. $mysqli = new mysqli($SQLhost, $SQLuser, $SQLpass, $SQLdbase);
  7. if ($mysqli->connect_errno) {
  8. echo 'Unable to connect to MySQL: ('.$mysqli->connect_errno.')'.$mysqli->connect_error;
  9. }
  10.  
  11. $query='SELECT * FROM WORDS'; // <<<<<<<<<<<<< WORDS - a sheet of DBase
  12.  
  13. $res = $mysqli->query($query);
  14.  
  15. if($res!=FALSE) {
  16. $res->data_seek(0);
  17. while ($row = $res->fetch_assoc()) {
  18. echo 'id='.$row['id'].'<br>';
  19. }
  20. }
  21. else echo 'still not there';
  22.  
  23. 1
Add Comment
Please, Sign In to add comment