Connecting to a database for my computer science A level project

Watch
NoaaaC
Badges: 10
Rep:
?
#1
Report Thread starter 3 months ago
#1
Hi,

I'll be needing to start my A-level project soon, so I wanted to get ahead of myself and start thinking about it now.

I have an idea, and I think I want to make it a web project but I also want to connect to a database to add a level of complexity that will hopefully give me more things to document.

What's my best approach for this? I will be making the logic for the program in JavaScript, so what's the best database to use and how would I connect to it from code? I'm assuming I'll need to use Node to make a connection

Thanks
0
reply
Strange5050
Badges: 17
Rep:
?
#2
Report 3 months ago
#2
You'll want to look at setting up a MySQL database. Connecting: https://www.w3schools.com/nodejs/nodejs_mysql.asp

Node.js is what you'll need to connect to the database. It can be done client-side via JavaScript although this is certainly not recommended, nor the best practice. What this will likely mean is you'll need to develop an API in Node.js (using Express.js will be your best bet for doing this) that will connect to the database. You can then configure 'endpoints' which you can call in your web-project which will get your API to query the database for whatever you need.

You'll need to make API calls in your web-project either via the likes of Ajax, fetch, or some other imported HTTP library.
Last edited by Strange5050; 3 months ago
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

Do you think receiving Teacher Assessed Grades will impact your future?

I'm worried it will negatively impact me getting into university/college (172)
44.1%
I'm worried that I’m not academically prepared for the next stage in my educational journey (43)
11.03%
I'm worried it will impact my future career (32)
8.21%
I'm worried that my grades will be seen as ‘lesser’ because I didn’t take exams (83)
21.28%
I don’t think that receiving these grades will impact my future (38)
9.74%
I think that receiving these grades will affect me in another way (let us know in the discussion!) (22)
5.64%

Watched Threads

View All