Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP CRUD Operations with PHP Creating Records Remembering Form Data

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

Anyone else get error when using your own editor?

I'm using my own editor instead of Workspaces, and everything was fine until we went to add Tasks. I get an error saying the date column does not exist in the database.

Error!: SQLSTATE[HY000]: General error: 1 table projects has no column named date

I also noticed in my editor that project_id, title are highlighted one color, but date and time are another in the line

$sql = 'INSERT INTO projects(project_id, title, date, time  p) VALUES(?, ?, ?, ?)';

Any ideas? Alena Holligan

:dizzy:

1 Answer

Filipe Pacheco
seal-mask
.a{fill-rule:evenodd;}techdegree
Filipe Pacheco
Full Stack JavaScript Techdegree Student 21,416 Points

Hi, Jason,

It's giving that error because you are adding to the projects table, instead of the tasks table. Also, what is that p right after time? Try this line of code instead.

$sql = 'INSERT INTO tasks(project_id, title, date, time) VALUES(?, ?, ?, ?)';
Jason Anders
Jason Anders
Treehouse Moderator 145,858 Points

Well then... Apparently I may need a little break, and why I usually don't do the copy/paste thing. I all too often forget to change something pretty important! :/

Thank you very much Filipe. Very much appreciated! :smile: