IgnaceV Posted May 10, 2023 Share Posted May 10, 2023 (edited) Ik have a database table "abbonees" (MariaDB) where I have among some textfields, following fields date (current_timestamp on time of registration), type date time ((current_timestamp on time of registration) type time end date (date + 7 days) type date end time ( time + 2 hours) type time When I use this code if ($_SESSION['pasw'] == $row["paswoord"]){ $_SESSION['ingelogd']="J"; $_SESSION['Naam']= $row["Naam"]; $_SESSION['VNaam']= $row["Vnaam"]; $_SESSION['edat']= $row["einddatum"]; When I try to login, Then I get this error: Warning: Undefined array key "einddatum" in /customers/1/5/0/fv-vl-ardennen.be/httpd.www/koepel/inlog.php on line 30 Warning: Cannot modify header information - headers already sent by (output started at /customers/1/5/0/fv-vl-ardennen.be/httpd.www/koepel/inlog.php:30) in /customers/1/5/0/fv-vl-ardennen.be/httpd.www/koepel/inlog.php on line 32 The first 3 are OK. What do I wrong? Edited May 10, 2023 by IgnaceV Quote Link to comment https://forums.phpfreaks.com/topic/316283-convert-date-to-string/ Share on other sites More sharing options...
Barand Posted May 10, 2023 Share Posted May 10, 2023 Try echo '<pre>' . print_r($row, true) . '</pre>'; to see what indexes $row does have. (Note - they are case-sensitive) Quote Link to comment https://forums.phpfreaks.com/topic/316283-convert-date-to-string/#findComment-1608270 Share on other sites More sharing options...
Solution IgnaceV Posted May 10, 2023 Author Solution Share Posted May 10, 2023 I think that I know what I am doing wrong. Array ( [IDR] => 5 [Naam] => Tester [Vnaam] => twee [mail] => service@ipathome.be [paswoord] => 314cfc36688da0847e6cbf7fe2961c96 ) Warning: Cannot modify header information - headers already sent by (output started at /customers/1/5/0/fv-vl-ardennen.be/httpd.www/koepel/inlog.php:30) in /customers/1/5/0/fv-vl-ardennen.be/httpd.www/koepel/inlog.php on line 32 I must extend my query. Quote Link to comment https://forums.phpfreaks.com/topic/316283-convert-date-to-string/#findComment-1608271 Share on other sites More sharing options...
IgnaceV Posted May 10, 2023 Author Share Posted May 10, 2023 Stupid that i Not have seen that. I learned a thing. Quote Link to comment https://forums.phpfreaks.com/topic/316283-convert-date-to-string/#findComment-1608272 Share on other sites More sharing options...
ginerjm Posted May 10, 2023 Share Posted May 10, 2023 Not sure what that "array" is that you posted. It sure isn't a valid PHP array. Missing a lot of quotes and commas Quote Link to comment https://forums.phpfreaks.com/topic/316283-convert-date-to-string/#findComment-1608273 Share on other sites More sharing options...
IgnaceV Posted May 10, 2023 Author Share Posted May 10, 2023 Now it is working. Thank you very much. Quote Link to comment https://forums.phpfreaks.com/topic/316283-convert-date-to-string/#findComment-1608274 Share on other sites More sharing options...
Barand Posted May 10, 2023 Share Posted May 10, 2023 13 minutes ago, ginerjm said: Not sure what that "array" is that you posted. It sure isn't a valid PHP array. Missing a lot of quotes and commas Don't you think it could be the output from print_r()? Quote Link to comment https://forums.phpfreaks.com/topic/316283-convert-date-to-string/#findComment-1608275 Share on other sites More sharing options...
ginerjm Posted May 10, 2023 Share Posted May 10, 2023 Didn't think of that way. Quote Link to comment https://forums.phpfreaks.com/topic/316283-convert-date-to-string/#findComment-1608276 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.