php - 这个mysql查询有什么问题?

标签 php mysql

<分区>

SELECT app_contracts.*, app_customers.id as customer, app_boards.id as board
 WHERE app_customers.id=app_contracts.customer_id 
 AND app_boards.id=app_contracts.board_id 
 ORDER BY app_contracts.id DESC

错误:

Error Number: 1064

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE app_customers.id=app_contracts.customer_id AND app_boards.id=app_contracts' at line 2

最佳答案

您需要在 WHERE 子句之前选择 FROM 某些东西(比如一个表)

关于php - 这个mysql查询有什么问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1104175/

相关文章:

php - Composer 安装 Laravel : Your requirements could not be resolved to an installable set of packages

php - "Notice: Undefined variable"、 "Notice: Undefined index"、 "Warning: Undefined array key"和 "Notice: Undefined offset"使用 PHP

php - 如何对 php 的 IP 地址数组进行 snmp

php - 在php中刷新mysql表值

PHP 的 mkdir 函数在 Windows 上的问题

python - 在 SQLAlchemy 中,如何在提交调试之前预览 SQL 语句?

mysql 错误,列为空

mysql - 检查日期的日名是否在日名列数据中

mysql - LARAVEL:找不到驱动程序(SQL:从 `app_settings` 中选择 *)(查看:/var/www/mendar-dev/resources/views/auth/login.blade.php)

mysql - 使用 laravel Eloquent 查询中的 Join 和 OrderBy