```js try { await env.DB.prepare( "INSERT INTO accesslog (ip, time, path) VALU

try {
          await env.DB.prepare(
            "INSERT INTO accesslog (ip, time, path) VALUES (?1, ?2, ?3)"
          ).bind(ip, time, pathname).run();
        } catch (error) {
          console.error(`Error while inserting row into accesslog table: ${error}`);
          return Response.json({ message: `Error while inserting row into accesslog table: ${error.message}` });
        }
      }

@HardAtWork
Was this page helpful?