Nightelf9
CDCloudflare Developers
•Created by Nightelf9 on 3/2/2024 in #pages-help
how to query DB from frontend using pages and D1
i figured it out - instead of doing the querying in the serverside DB.js code in the functions folder I did all the filtering searching in the javascript.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SQL Test</title>
<link rel="stylesheet" href="stylesheet.css">
</head>
<body>
<h1>Search Customers</h1>
<label for="companyName">Enter Company Name:</label>
<input type="text" id="companyNameInput" placeholder="Type company name...">
<button id="searchButton">Search</button>
<div id="resultsContainer"></div> <script src="./javascript.js"></script> </body> </html> i inputted a search for the company name and it then inputted that as a variable into the code to find the arrays/objects with the company = searchinput
<div id="resultsContainer"></div> <script src="./javascript.js"></script> </body> </html> i inputted a search for the company name and it then inputted that as a variable into the code to find the arrays/objects with the company = searchinput
2 replies
CDCloudflare Developers
•Created by Nightelf9 on 1/6/2024 in #d1-database
hey guys im a beginner and am trying to
thanks for all your help
4 replies
CDCloudflare Developers
•Created by Nightelf9 on 1/6/2024 in #d1-database
hey guys im a beginner and am trying to
4 replies
CDCloudflare Developers
•Created by Nightelf9 on 1/6/2024 in #d1-database
hey guys im a beginner and am trying to
4 replies
CDCloudflare Developers
•Created by Nightelf9 on 1/6/2024 in #d1-database
hey guys im a beginner and am trying to
thanks!
would it be
const response = await fetch("/functions/getAnimals", { as its in the functions directory?
const response = await fetch("/functions/getAnimals", { as its in the functions directory?
4 replies