So I am trying to work on this block of code for a personal project. This is an iteration of a sql query that is being passed by php.
1 $sql = "SELECT * FROM `table 1`";
2 $result = $conn->query($sql);
3
4 if ($result->num_rows > 0) {
5 // output data of each row
6 while($row = $result->fetch_assoc()) {
7 echo "id: " . $row["ID"]. " - Spell Name: " . $row["Spell Name"]. " -
8 School " . $row["S"]. "<br>";
9 }
10 } else {
11 echo "0 results";
12 }
13 $conn->close();
When I run it, it gives
Notice: Trying to get property of non-object on line
I simply pulled this from the w3school tutorial, and replace the relevant column names. Just for the record, the dataset I am working with has roughly entries