0

I make a looping system in my localhost use xampp and it's work in my friend localhost also work. but when I upload it to hosting it's not working and when I try in mac local host, it not working to.

my looping system is very simple.

<?php
include 'koneksi.php';
    $tampil=$db->query("SELECT * FROM soal ORDER BY Rand()");
    while($data=$tampil->fetch_object()){
    ?>
            <h3>hallo</h3>
            <?php
    }
?>
Momin
  • 3,200
  • 3
  • 30
  • 48
  • normally a blank page is some error - but your environment might have turn off error reporting. – Simos Fasouliotis Apr 19 '17 at 09:30
  • Make your youre database connection works fine on your server. – Twinfriends Apr 19 '17 at 09:31
  • Get a better picture of what is going on by using var_dump, ie. var_dump($tampil); and you could also forget the loop for now and just define $data=$tampil->fetch_object() and on the next line var_dump($data). Should give you a better insight. – HomerPlata Apr 19 '17 at 09:32
  • When you ask a question about an error **ALWAYS** include the **error log**. Add `error_reporting(E_ALL); ini_set('display_errors', 1);` at the top of your `php` script, what does it return? – Pedro Lobito Apr 19 '17 at 09:32
  • its because your connection on the live hosting is incorrect – Masivuye Cokile Apr 19 '17 at 09:37

0 Answers0