質問編集履歴

2

コード追記

2022/04/07 07:23

投稿

moritaryo
moritaryo

スコア11

test CHANGED
File without changes
test CHANGED
@@ -2,6 +2,68 @@
2
2
 
3
3
  Controllerでcreateメソッドを使っていて今までは問題なく動いていたのですが、突然エラーを出すようになってしまいました。ご教授お願いいたします。
4
4
  ```ここに言語を入力
5
- SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name '~~'
5
+ SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name 'example'
6
+
7
+ select
8
+ count(*) as aggregate from `example `where `name` = a
9
+ ```
10
+ ```ここに言語を入力
11
+ * @throws \Illuminate\Database\QueryException
12
+
13
+ */
14
+
15
+ protected function runQueryCallback($query, $bindings, Closure $callback)
16
+
17
+ {
18
+
19
+ // To execute the statement, we'll simply call the callback, which will actually
20
+
21
+ // run the SQL against the PDO connection. Then we can calculate the time it
22
+
23
+ // took to execute and log the query SQL, bindings and time in our memory.
24
+
25
+ try {
26
+
27
+ return $callback($query, $bindings);
28
+
29
+ }
30
+
31
+
32
+
33
+ // If an exception occurs when attempting to run a query, we'll format the error
34
+
35
+ // message to include the bindings with SQL, which will make this exception a
36
+
37
+ // lot more helpful to the developer instead of just the database's errors.
38
+
39
+ catch (Exception $e) {
40
+
41
+ throw new QueryException(
42
+
43
+ $query, $this->prepareBindings($bindings), $e
44
+
45
+ );
46
+
47
+ }
48
+
49
+ }
50
+
51
+
52
+
53
+ /**
54
+
55
+ * Log a query in the connection's query log.
56
+
57
+ *
58
+
59
+ * @param string $query
60
+
61
+ * @param array $bindings
62
+
63
+ * @param float|null $time
64
+
65
+ * @return void
66
+
67
+ */
6
68
  ```
7
69
  tableの設定などは動いていた時から変わっておらず、キャッシュとかの関係なのかな、と思い消してみましたが変わりませんでした。

1

追記

2022/04/05 18:46

投稿

moritaryo
moritaryo

スコア11

test CHANGED
File without changes
test CHANGED
@@ -4,4 +4,4 @@
4
4
  ```ここに言語を入力
5
5
  SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name '~~'
6
6
  ```
7
-
7
+ tableの設定などは動いていた時から変わっておらず、キャッシュとかの関係なのかな、と思い消してみましたが変わりませんでした。