r/PHPhelp • u/Theo468 • Nov 01 '25
Solved Undefined Array Key - Send Help!
Hello,
Looking for some assistance. I am currently doing a course on PHP and inputting data from a database but I'm getting an error "Undefined array key"
Can someone help me and tell me what I've missed?
The code was copy and pasted direct from what the lecturer gave us.
I'd ask my lecturer but with it being the weekend they are unavailable until Monday and this is annoying me.
Thanks
3
Upvotes
View all comments
Show parent comment
3
u/lOo_ol Nov 01 '25 edited Nov 01 '25
Upper/lowercase is a common mistake even senior devs can make. Don't stress about it.
Just to complete the answer and help you understand how associative arrays work, the key in
$row['artist']isartist. Here are a few examples: