I have simple inventory DB. When trying to access the products table and display the data in a table, i continually get "Unidentified index" and nothing i have found thus far can assist me. I am just starting PHP
conn.php
<?php
$servername = "localhost";
$username = "root";
$password = "";
$database = "slfs_storesb";
// Create connection
$conn = new mysqli($servername, $username, $password, $database);
// Check connection
if ($conn->connect_errno) {
printf("Connection failed: %s\n" . $conn->connect_error);
}
?>
index.php
<?php
$sql = "select * from tbl_station";
$result = mysqli_query($conn,$sql);
while($row = mysqli_fetch_assoc($result)) {
var_dump($row);
// print $row[4];
//echo '<table id="t01">';
echo $row["Station_id"]." ".$row["Station_name"]." ". $row["Station_email"];
// echo '</table>';
}
// } else {
// echo "0 results";
// }
?>
THis is the error
Notice: Undefined index: Station_id in C:\wamp\www\stores\index_1.php on line 21
Call Stack
# Time Memory Function Location
1 0.0010 246504 {main}( ) ..\index_1.php:0
Gros Islet Fire Station
( ! ) Notice: Undefined index: Station_id in C:\wamp\www\stores\index_1.php on line 21
Call Stack
# Time Memory Function Location
1 0.0010 246504 {main}( ) ..\index_1.php:0
GFL Fire Hall
( ! ) Notice: Undefined index: Station_id in C:\wamp\www\stores\index_1.php on line 21
Call Stack
# Time Memory Function Location
1 0.0010 246504 {main}( ) ..\index_1.php:0
HeadQuarters
( ! ) Notice: Undefined index: Station_id in C:\wamp\www\stores\index_1.php on line 21
Call Stack
# Time Memory Function Location
1 0.0010 246504 {main}( ) ..\index_1.php:0
Dennery class footer { This is footer }