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 Project Setup Introduction to the Project

Wayne Comber
Wayne Comber
8,169 Points

How can I use the database file in my XAMPP MySQL installation?

Hi,

I have downloaded the project files for the course, and I am wondering if there is a way I can load the database file into my XAMPP install which has MySQL as its database? Thanks

5 Answers

Wayne Comber
Wayne Comber
8,169 Points

Never mind. I found the database.sql file at the bottom of the Reading Project Data video. Copied that into the SQL script area in my MySQL database and we are good to go.

I downloaded the sql file from the Reading Project Data video but it's for a different table that gets introduced in that video. I'm not sure why instructor uses .db for one video and the .sql for another?

Renzo Salvador
Renzo Salvador
523 Points

So the conexion file changes right?

Wayne Comber
Wayne Comber
8,169 Points

Thanks Jonathon. I tried changing the extension and importing it, and phpmyadmin said there were 1351 errors! Not going to be able to sort all those out. Any other ideas?

Wayne Comber
Wayne Comber
8,169 Points

Thanks for your reply Mikkel. I had already tried that. The problem is that the database file that came with the project files has a .db extension, and wont import that way.

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,253 Points

change the file extention to and sql file. You have have to do some poking around to fix any errors phpmyadmin finds but it should work. :-)

Mikkel Rasmussen
Mikkel Rasmussen
31,772 Points
  1. Go to localhost/phpmyadmin/

  2. Make a new database or use an existing one.

  3. Open the sql file.

  4. Copy paste all text into SQL - remember to have the database selected :)

Tom Goldie
PLUS
Tom Goldie
Courses Plus Student 8,379 Points

I ran into the same problem in WAMP. Turns out you must import the file into an existing database. So I just created the database with the defaults in phpmyadmin, then was able to import the sql file. And yes, the database file is where you said (thanks for that), but inconvenient that the download link isn't included in the first tranche of videos, but in the second - Creating Records: Reading Project Data....