0

as the title say i'm having a problem with the column that i just added in the table for my users. i'm getting a Notice: Undefined index:

this is my code:

$user = $_SESSION['user'];
echo "Your Job:".$user['job'];

I've tried to change the job to the username of the users and its working but for the new column that i add even though it has a value it's not working. i also try to insert a value in the new column that i add and its working fine but for getting its value its not working.

Keii
  • 39
  • 1
  • 7
  • What you have shown so far, only accesses the session - that does not even have any direct connection to any database stuff. We don’t know what you have stored in there, where you are filling this object and with what. Please go read [ask] and [mre], and then edit your question accordingly - you need to show us the actually relevant code parts. – CBroe Mar 13 '20 at 11:49
  • As a starting point you could use [var_dump()](https://www.php.net/manual/en/function.var-dump.php) to print all information in the variable, – chrwahl Mar 13 '20 at 11:49
  • what is result of print_r($user) ; – Sandeep Modak Mar 13 '20 at 11:49
  • The code you posted is irrelevant. How do you expect to be helped? – Elias Soares Mar 13 '20 at 11:50
  • @SandeepModak only this Array ( [username] => test [status] => 0 [user_id] => 7 ) . the password and job column was not included. – Keii Mar 13 '20 at 11:52

0 Answers0