Jump to content
Stef's Coding Community

CRUD basics with Mysqli & PHP part2: undefined property error.

Recommended Posts

Hi I've been typing along with this and in part 2 I'm getting the error below:

Notice: Undefined property: stdClass::$lastname in C:\MAMP\htdocs\CRUD-my-php\view.php on line 27

This repeats 5 times on the page once for each row. The table displays as it should below these 5 errors except for the "lastname" column which is blank except for the heading. As I copied and pasted the code for the "id" row as suggested in the video I'm at a loss as to where the error is?



The code for this section is below as I've typed it:



It dosesn't look any less baffling in big letters.? I'm working with Windows 10 in Sublime text 3.

That's it for I'm done for today, time for a cuppa and to descend upon this packet of ginger nuts like Atilla and the boys on a day trip to Rome.? ?



Link to post
Share on other sites

Hi fra168nk,?

Thanks, it did indeed help. I've been over that line 27 numerous times but you're asking that question made me look at it differently.

It was a typo alright, though?not in the sublime text doc, it was in the column name in phpmyadmin. I had it headed "second name"! I never thought to look at that. That'll be another part of the mental map of how things work hammered into place.??

This has caused no end of doubt and anguish so thanks again????

Link to post
Share on other sites

Not the first and I'm sure not the last time I'll be reminded of that and?I'm grateful for all these reminders, they help to maintain?some perspective.

I'm beginning to think that bloody minded stubbornness might be the most important?character trait for anyone trying to get into this field.

10 hours ago, administrator said:

Welcome to programming!???

Is the?Buddha's "Life is suffering"?paraphrased for nerds.?

Link to post
Share on other sites

PS. Hi Stef, a?final note on this project.?I wasn't able to get the "Add record" function to work even if I did a clean download of the project files and loaded them instead of the ones I'd done working along to the videos. Do we have a bug somewhere in the works??

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...