PHP Developers Network
http://forums.devnetwork.net/

table does't exists error . Why ??
http://forums.devnetwork.net/viewtopic.php?f=72&t=143290
Page 1 of 1

Author:  gautamz07 [ Sat Jan 14, 2017 10:09 am ]
Post subject:  table does't exists error . Why ??

I have the table `tags`in my database 'peckinga_blog' , Now this works perfectly fine in my local environment , but when i upload to the server i get the following error:

Syntax: [ Download ] [ Hide ]
QueryException in Connection.php line 729:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'peckinga_blog.Tags' doesn't exist (SQL: select * from `Tags`)



Why am i getting this error and how can i overcome this ?

Author:  gautamz07 [ Sat Jan 14, 2017 10:55 am ]
Post subject:  Re: table does't exists error . Why ??

I saw this answer here ,
http://stackoverflow.com/a/20795986/4381665

but how do i solve the problem

Author:  requinix [ Sat Jan 14, 2017 10:59 am ]
Post subject:  Re: table does't exists error . Why ??

Either
a) You didn't create the table on that server. Fix the problem by creating the table.
b) You created it with a different name (perhaps lowercase "tags"). Fix the problem by changing your query to use the right table name.

Author:  gautamz07 [ Sun Jan 15, 2017 6:05 am ]
Post subject:  Re: table does't exists error . Why ??

Its the 2nd one , i have the table tags and on the server it seems to be looking for Tags . I am using laravel . is there someway i can make it look for tags without changeing the database .

Author:  requinix [ Sun Jan 15, 2017 6:17 am ]
Post subject:  Re: table does't exists error . Why ??

Somewhere there is code telling it to look for that table. Find it and change it. I don't know your codebase any better than you.

Author:  gautamz07 [ Sun Jan 15, 2017 6:58 am ]
Post subject:  Re: table does't exists error . Why ??

ok thanks requinix.

Author:  Celauran [ Sun Jan 15, 2017 9:11 am ]
Post subject:  Re: table does't exists error . Why ??

Are you doing this through migrations? Have you run the migrations on the server as well as on local? A Tag Eloquent model should map to tags table unless you have specifically overridden it.

Author:  gautamz07 [ Mon Jan 16, 2017 5:34 am ]
Post subject:  Re: table does't exists error . Why ??

Hey celauran !

No i run the migrations only locally and exported the database to my server via phpmyadmin.

check the 3rd answer here -> http://stackoverflow.com/questions/2079 ... 6#20795986

could that be the problem ?

Author:  Celauran [ Mon Jan 16, 2017 10:50 am ]
Post subject:  Re: table does't exists error . Why ??

Don't know. Have you tried?

Have you set up the .env file on your production server? Are you connecting to the database? Is it just this table? Are other tables working? Code?

Author:  gautamz07 [ Tue Jan 17, 2017 1:01 pm ]
Post subject:  Re: table does't exists error . Why ??

@celauran , yes i have setup the .env file for my production server and just for testing puposes i turned the the following to true:

Syntax: [ Download ] [ Hide ]
APP_DEBUG=true
 


its says it cannot find the table , i have two tables tags and admin , in both cases its looking for Tags and Admin .. thats the problem . is that conclusive enough ?

Author:  Celauran [ Tue Jan 17, 2017 2:50 pm ]
Post subject:  Re: table does't exists error . Why ??

And you've checked that the tables actually exist? I'd listen to the error message.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/