is there any difference between ubuntu desktop vs homestead? because when i query using where clause like where('id',1) on my ubuntu desktop I couldnt get the data while on the homestead I can. but when i add quote on my code like where('id','1'), I can now get the data on my ubuntu desktop. is there any problem with my php installation and btw, im also using the repository used by homestead php but i have the latest version of it.
the workaround for now is using laravel's model casting. I set the attribute to integer so I will no longer put quote on the variable on where clause.
it will always return string on my query.
ok. I got it guys. you need to install php5-mysqlnd extension. :D
this is few times i have seen this error crop up.. how weird.. I know that is not super helpful but do search around here & i can see if i can find other threads that may contain some solution
shez1983 said:
this is few times i have seen this error crop up.. how weird.. I know that is not super helpful but do search around here & i can see if i can find other threads that may contain some solution
I hope you can help me with this.
I believe this is due to mysql "Strict Mode". Please research it on the web.
The recent releases of mysql have mysql_mode set to "STRICT_TRANS_TABLES" by default. This holds for your ubuntu install.
Homestead mysql explicitly sets the mysql_mode to "". This relaxes several database rules relating to casting and null checks.
Note that laravel now offers a config flag in database.php->mysql named "strict" that defaults to false. You can set it to true to have laravel generate sql that plays nice with strict mode.
Hope this helps!
mnshankar said:
I believe this is due to mysql "Strict Mode". Please research it on the web.
The recent releases of mysql have mysql_mode set to "STRICT_TRANS_TABLES" by default. This holds for your ubuntu install.
Homestead mysql explicitly sets the mysql_mode to "". This relaxes several database rules relating to casting and null checks.
Note that laravel now offers a config flag in database.php->mysql named "strict" that defaults to false. You can set it to true to have laravel generate sql that plays nice with strict mode.
Hope this helps!
doesnt work :(
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community