Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. <?php
  2.  
  3. require '../config.php';
  4. require '../connect.php';
  5.  
  6. $sql = "SELECT `indirstab` FROM `operatori`";
  7. $result = mysqli_query($link,$sql);
  8.  
  9. $data=array();
  10. while($row = mysqli_fetch_assoc ( $result )) {
  11.  
  12. if(json_encode($row)!=false){
  13. array_push($data,$row);
  14. } else {
  15. echo "Errore stringa: ".$row['indirstab'];
  16. }
  17.  
  18. }
  19. $stringa = json_encode($data);
  20. if($stringa!=false){
  21. echo $stringa;
  22. } else {
  23. echo "Errore";
  24. }
  25.  
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement