0
<?php 

include 'connection.php';
$sql="SELECT * FROM students ";
$result=mysqli_query($conn,$sql);

?>

This is my little sql code for displaying all from the DB.It worked yesterday perfectly but i tried to change some things and now when i back up my code it doesn't working .

<table border=2px;>
    <tr>
        <th>Id</th>
        <th>Име</th>
        <th>Факултетен Номер</th>

    </tr>
<?php 

     if (mysqli_num_rows($result) > 0) {
     while ($row = mysqli_fetch_array($result)) {
 ?> 
 <tr>
    <td><?php echo $row["student_id"]; ?></td>
     <td><?php echo $row["student_fname"]. "  " .$row["student_lname"] ?></td>
     <td><?php echo $row["student_fnumber"]; ?></td>
 </tr>  
  <?php 
     }
     }
     ?>
</table>

This is my HTML

Brad Larson
  • 170,088
  • 45
  • 397
  • 571
R.Koy
  • 1
  • 5
  • Doesnt look to be enough code in here. You should give the [mcve] a read to see what code is required. Anyway, two things that may help with your issue is if you can get [php errors](https://stackoverflow.com/questions/1053424/how-do-i-get-php-errors-to-display) to display and check for [mysqli errors](http://php.net/manual/en/mysqli.error.php) whilst you're at it. – IsThisJavascript Jun 18 '18 at 10:50
  • what error are you getting? – Masivuye Cokile Jun 18 '18 at 10:51
  • Can you use; mysqli_error($conn); And post the result here. – J Quest Jun 18 '18 at 11:03

1 Answers1

0

You are missing a semi-colon at the end of your PHP instruction, here :

<?php echo $row["student_fname"]. "  " .$row["student_lname"] ?>

Normally for that kind of errors, the PHP intepreter should give you a clear error message and a line number and you should have found it by yourself.

If you dont get any error message, you should fix this on your server because it is very hard, especially for a beginner, to figure out where an error is without any message.

There are many root causes to error reporting missing, start here for instance Not getting PHP errors?

Thomas G
  • 9,886
  • 7
  • 28
  • 41