From the course: Code Clinic: JavaScript
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Passing information to our database - JavaScript Tutorial
From the course: Code Clinic: JavaScript
Passing information to our database
- [Speaker] So though we're getting some information from our database, we need to be able to pass along some values to our database in order to get the right information. So what I'm gonna do is create a few variables here. So be a let and then fromDate, and we'll just plug in a value here. And then we'll create a fromTime. And then we'll need some values for what happens... At the end of the range, so toDate and toTime, and, I'm just gonna make this, 10 here so it'll be like 1:00 a.m, and 10:00 a.m. And what I want to do is add a body method here, so, in this fetch command I can do a very simple fetch with just a URL, and because this is GAT and we're getting some information, that would just fine if we do want to pass along information, then we'll need to use something like POST method. And once we do that, we need to specify a body. And this is essentially what you're going to be sending to the database. So here, we're gonna need to use a method called JSON stringify, to convert…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
Intro: The weather at Pond Oreille1m 51s
-
Solution overview2m 20s
-
Accessing the MySQL database7m 13s
-
Reading data with fetch()4m 17s
-
Passing information to our database2m 56s
-
Charting basic data with C3.js5m 42s
-
Plotting multiple graphs9m 28s
-
Customizing the chart display4m 32s
-
Controlling the interface9m 30s
-
-
-
-
-
-