Home » Php » Undefined Index, invalid input syntax for integer errors in HTML-PHP-PDO-PostgreSQL based forms data insertion

Undefined Index, invalid input syntax for integer errors in HTML-PHP-PDO-PostgreSQL based forms data insertion

Posted by: admin June 30, 2018 Leave a comment

Questions:

I am working on a web page to store some data in a postgresql using php-pdo. I have so far made two forms to insert user entered data into two tables.

The data is successfully inserted into the tables but following notices and one error is raised.

Here are my questions?

1)How to correct errors & warnings?

2) In the code line echo"<thead class='table-dark'>", I am trying to make the heading of the tables dark but it’s not working.

ERRORS

Notice: Undefined index: l_id in C:\xampp\htdocs\ubicomp\index3.php on line 97

Notice: Undefined index: time in C:\xampp\htdocs\ubicomp\index3.php on line 97

Notice: Undefined index: m_gps in C:\xampp\htdocs\ubicomp\index3.php on line 97
SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: "" LINE 2: VALUES ('','01','','') ^ 

CODE

Here are the queries for the tables.

Table2:

Answers: