I feel like I'm missing something here.
Notice: Undefined index: Products/Services in C:\xampp\htdocs\db\npcphptext.php on line 22
I cannot for the life of me work out what is wrong with line 22, and I have googled around and asked friends to no avail, as well as looking on here.
Please somebody enlighten me. I posted this on stackoverflow and it was taken straight down for being a duplicate...
// Check connection
echo "Failed to connect to MySQL: " . mysqli_connect_error();
$result = mysqli_query($con,"SELECT * FROM NPC");
echo "<table border='1'>
<th>Products or Services</th>
while($row = mysqli_fetch_array($result))
echo "<td>" . $row['id'] . "</td>";
echo "<td>" . $row['Products or Services'] . "</td>";
echo "<td>" . $row['Price'] . "</td>";
I have been advised: 'var_dump($row); at the top of your while loop to find out what indexes it contains' and: 'The key Products/Services (or Products or Services, your code is different than your error message) does not exist in $row. You need to look at the contents of $row to find out what keys do exist'
but I am a noob and only understand plain English, essentially.