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...
<?php
$con=mysqli_connect("localhost","root","13151083","NPC");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$result = mysqli_query($con,"SELECT * FROM NPC");
echo "<table border='1'>
<tr>
<th>id</th>
<th>Products or Services</th>
<th>Price</th>
</tr>";
while($row = mysqli_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['id'] . "</td>";
echo "<td>" . $row['Products or Services'] . "</td>";
echo "<td>" . $row['Price'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysqli_close($con);
?>
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.