douyicao2199 2014-12-03 17:18
浏览 22

如何使用Laravel 4将数据保存到我的生产/开发服务器中?

I want to keep track on log-in info of my users. In my Sign-In function, somewhere at the end I did this

if(Auth::check()){
    $user = Auth::user();
    $user->last_logged_in = Input::get('created_at');
    $user->logged_in_count = $user->logged_in_count + 1 ;
    $user->is_online = '1';
    $user->save();
    }

The problem is that it's work locally, when I check it on phpMyAdmin. I use WAMP Server.

BUT It's doesn't work on my production/dev server that running on Linux OS.

This line didn't get save on the server.

$user->last_logged_in = Input::get('created_at');

and also this line

$user->is_online = '1';

But the logged_in_count work

$user->logged_in_count = $user->logged_in_count + 1 ;

Why??? Is it because they're running on different OS ? The ugly part is that some of them get save, and some of them doesn't.

Did someone come across this issue before ?

Huge THANK for any tips/suggestions on this!

  • 写回答

1条回答 默认 最新

  • dsns47611 2014-12-03 17:45
    关注

    Sounds like you might have strict mode enabled in your production MySQL settings.

    You can turn this off in the MySQL config file, if you don't have access try casting your variables correctly (so use intval to ensure an integer on a numeric field etc).

    评论

报告相同问题?

悬赏问题

  • ¥15 多址通信方式的抗噪声性能和系统容量对比
  • ¥15 winform的chart曲线生成时有凸起
  • ¥15 msix packaging tool打包问题
  • ¥15 finalshell节点的搭建代码和那个端口代码教程
  • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据