The two firs messages indicate that the value for those indices is not set. Before fetching the values, you can use PHP: isset - Manual
] to investigate if the value is actually set or not.
The third message seems like you might have a typo. Instead of
Should it be
Then about the query, always use parameterized queries. Using the values directly leaves you wide open to SQL injection - Wikipedia
For parameterized queries, have a look at for example PHP: Prepared Statements - Manual
] and PHP: mysqli::prepare - Manual