【问题标题】:Parse error: syntax error, unexpected ''aws_account.aws_account_id'' (T_CONSTANT_ENCAPSED_STRING) in project [duplicate]解析错误:语法错误,项目中出现意外的“aws_account.aws_account_id”(T_CONSTANT_ENCAPSED_STRING)[重复]
【发布时间】:2015-06-21 08:21:29
【问题描述】:

我遇到了以下错误,但我看不出有什么问题:

解析错误:语法错误,第 11 行 C:\xampp\htdocs\laravel\awsconfig\app\controllers\CRUDController.php 中出现意外的“aws_account.aws_account_id”(T_CONSTANT_ENCAPSED_STRING)

抛出错误的我的连接语句:

$query = DB::table('ec2_instance')->join('aws_account', 'aws_account.id', '=', 'ec2_instance.id')->select('ec2_instance.instance_id', 'ec2_instance.public_dns_name', 'ec2_instance.key_name','ec2_instance.instance_type','ec2_instance.launch_time',‌​'aws_account.aws_account_id')->get();

【问题讨论】:

  • 看起来更像where() 的语法而不是join() 的语法
  • 此代码不会产生该错误。你贴对了吗?

标签: php mysql laravel-4


【解决方案1】:

在最后一个 , 和 ' 之间有一些垃圾字符:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-05-24
    • 2023-04-09
    • 1970-01-01
    • 2013-04-27
    • 1970-01-01
    • 2018-06-28
    • 2016-02-07
    相关资源
    最近更新 更多