From the course: Hands-On AI: Build a Web-Based Movie Review Generator Database with Generative AI, HTML, CSS, and PHP

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Using AI to write a class to talk to the database: Front-end functions

Using AI to write a class to talk to the database: Front-end functions

- [Instructor] Okay, so we have our plan for how we're going to organize our database and files. So now let's actually add this code to our project. So this is a good Class. Let's make sure that the Classes it's generating our full. So we'll say: I'm ready to add this code to my project. For includes... It was includes database, right? Includes/db.php. For /includes/db.php, can we make sure this is a complete Class that is ready to be added to the project? All right, this is great. So let's add this first, and this is going in includes/db and we will replace the credentials here with the ones we have from test-db. These are private, so let's make sure to replace that. Okay. What is the error that we have here? Oh, that was a nice visual cue that we got there from VS Code. And now we're good to go. Fantastic. Now can we do the same for MovieDB? All right, so you can see what it's doing here, right? Because we do want to review this code. Don't use any emoji in... Okay, so we'll go…

Contents