PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Sun Jun 25, 2017 5:36 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 11 posts ] 
Author Message
PostPosted: Sat Jan 14, 2017 10:09 am 
Offline
Forum Contributor
User avatar

Joined: Wed May 14, 2014 12:18 pm
Posts: 319
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 ?


Top
 Profile  
 
PostPosted: Sat Jan 14, 2017 10:55 am 
Offline
Forum Contributor
User avatar

Joined: Wed May 14, 2014 12:18 pm
Posts: 319
I saw this answer here ,
http://stackoverflow.com/a/20795986/4381665

but how do i solve the problem


Top
 Profile  
 
PostPosted: Sat Jan 14, 2017 10:59 am 
Offline
Spammer :|
User avatar

Joined: Wed Oct 15, 2008 2:35 am
Posts: 6442
Location: WA, USA
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.


Top
 Profile  
 
PostPosted: Sun Jan 15, 2017 6:05 am 
Offline
Forum Contributor
User avatar

Joined: Wed May 14, 2014 12:18 pm
Posts: 319
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 .


Top
 Profile  
 
PostPosted: Sun Jan 15, 2017 6:17 am 
Offline
Spammer :|
User avatar

Joined: Wed Oct 15, 2008 2:35 am
Posts: 6442
Location: WA, USA
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.


Top
 Profile  
 
PostPosted: Sun Jan 15, 2017 6:58 am 
Offline
Forum Contributor
User avatar

Joined: Wed May 14, 2014 12:18 pm
Posts: 319
ok thanks requinix.


Top
 Profile  
 
PostPosted: Sun Jan 15, 2017 9:11 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6249
Location: Montreal, Canada
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.

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
PostPosted: Mon Jan 16, 2017 5:34 am 
Offline
Forum Contributor
User avatar

Joined: Wed May 14, 2014 12:18 pm
Posts: 319
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 ?


Top
 Profile  
 
PostPosted: Mon Jan 16, 2017 10:50 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6249
Location: Montreal, Canada
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?

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
PostPosted: Tue Jan 17, 2017 1:01 pm 
Offline
Forum Contributor
User avatar

Joined: Wed May 14, 2014 12:18 pm
Posts: 319
@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 ?


Top
 Profile  
 
PostPosted: Tue Jan 17, 2017 2:50 pm 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6249
Location: Montreal, Canada
And you've checked that the tables actually exist? I'd listen to the error message.

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group