Why am i getting these errors | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
16th Nov 2020, 11:18 PM
Joseph Oritseweyinmi
Joseph Oritseweyinmi - avatar
3 Answers
+ 2
The errors are pretty clear if you read them. There are only 2, but they repeat multiple times due to the loop. The variable $name is undefined The index "message" is undefined You're trying to use a variable $name that is not defined within the scope of its use. For the index "message", first it must exist in the DB, second you need to add it to your query.
16th Nov 2020, 11:43 PM
ChaoticDawg
ChaoticDawg - avatar
+ 2
Are you sure that the sendMessage.php file is being found? Try temporarily changing to require and see if you get a fatal error. If so double check for a reason that it's not found I.E. spelling, relative location, etc. Is the 'message' index being returned with your query? Try printing out the entire row and see.
16th Nov 2020, 11:53 PM
ChaoticDawg
ChaoticDawg - avatar
0
The $name variable is in the sendmessage.php a d the message index exists
16th Nov 2020, 11:50 PM
Joseph Oritseweyinmi
Joseph Oritseweyinmi - avatar