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 Laravel 4 Basics Laravel and Databases Eloquent ORM

Brian Patterson
Brian Patterson
19,588 Points

QueryException in Connection.php line 647: SQLSTATE[42S02]: Base table or view not found:

I am getting the above error. I am using laravels 5 and have added the suggested code from the forum. Also, created a MemberList.php (I am creating my own database) with the following code.

<?php
namespace App;  // new
use Eloquent;   // new

class MemberList extends Eloquent {}

In my controller I have added the following.

public function index()
    {
        $members = \App\MemberList::all();
        return view('members.index')->with('members'.$members);
    }

I was doing alright up to this point. Any help would be appreciated.

Simon Coates
Simon Coates
28,694 Points

Googled the error as i'm not super familiar with laravel. Some people seem to have gotten the error as a product of spelling mistakes with table names and other people didn't run migration to install the model (can use a view on db to confirm).

1 Answer

Brian Patterson
Brian Patterson
19,588 Points

Thanks Simon for the reply. I have pretty much given up on this course as it is so out of date. Although, it did give me some exposure to the framework. Have decided to do this with Laracasts.

Simon Coates
Simon Coates
28,694 Points

yep. For whatever reason, the laravel tutorials for a couple of the different online learning services at still stuck at 4. (i checked lynda, treehouse a month or so back).