I've recently ported a simple database from Ms Access to SQLite, because I wanted an open source option. Now I'm facing the problem of developing a visual form for data entry in that database.
This related question (HTML/JS as interface to local SQLite database) pretty much summaries what I want to do: create an HTML/JavaScript frontend for data entry in a SQLite local database. In that thread, the user solved the issue by creating a local web server via Python script.
The question is: how do I connect my HTML file to that local web server? Is that via PHP or something similar? Please point me to the right research direction. Thank you!
Yes, you should use PHP or something similar, possibly Ruby on Rails or Django. The last two make life really easy and help abstract the database.
Related
I am trying to connect my Forge app to a sql database, but I have no idea how to do that. I am new to forge and web development, so I don't know how to look for the best approach to solve this.
I found a code that does exactly what I want, that is getting the data from a specific table of my database, but I'm not able to put this code inside my forge app, mainly because it uses a require() function and I can't put it inside my extension button.
By the way, I'm trying to make a button in my extension where I click, it access my database and get data from it.
Would be really nice if someone could help me with this silly doubt that probably already has a solution in the internet and I'm not able to find it.
Sorry in advance if it's too obvious.
This problem is more related to web development than Forge.
Your app should be made of 2 parts : the frontend (html/css/js) and a backend (probably nodejs as you tagged it).
Your frontend should not access the database directly. This is the job of your backend.
In your backend, add a library to access your database such as Sequelize (if you are working with NodeJS). Then you will do a request from your frontend to your backend to get the data from the database.
You probably have something working like that for your Forge Access Token, depending on what you use to start your development.
Okay so its like this. I am using Microsoft Visual Studios (Javascript/HTML/CSS coding) to create an app which retrieves and sends data into a MySQL database. I setup my MySQL database using MySQL workbench. I created a localhost and connected Visual Studios to the database. It shows the connection on the Server Explorer on the left side of the IDE.
And this is where I get stumped. I don't know how exactly to retrieve the data set inside that database. I've been taught to use Eclipse and phpMyAdmin using a php file to connect, retrieve and store data into the database.
However, I am not familiar with how Visual Studios do their data retrieval. How do I go about this guys?? Basically, I got an HTML file, a CSS file, a Javascript file, I got the MySQL database running and it says I have connection to it on Visual Studios.
The database name is EmployeeCred, and inside the database is a table called employeelogindata with columns of informations.
What should I do?
You'll need to create some sort of API for your JavaScript(frontend) to interact with. You could create a PHP API(backend) which would connect to the database and return JSON data for your frontend. You could then access this using the JavaScript fetch API
Actually, for those still wondering how, Visual Studios has a service for Cordova App which allows for a built-in backend service to the app. Simply go to the Overview panel and look up the backend service feature. Follow the steps and read through the Corodva Documentation available on the internet.
I need to make a dead simple web application. Users hit a static HTML page and enter some basic info (name, and comment). When they hit submit, I want to store this info in either a CSV file or a sqlite on the hosting server. I know all of this is possible with django/python or ror/ruby but is there anyway to do this with just JavaScript?
Thanks in advance..
There's few ways to handle this, using just javascript. Which is to use a hosted Backend-as-a-Service.
You would need to make API calls on the client end, and will be able to connect to it without having to rely on a backend technology.
Most of these technologies are built for mobile, but you can still use it to build it on your static HTML pages. (cross browser issues may vary).
Here are some:
Firebase (https://www.firebase.com/docs/web-quickstart.html)
Parse (https://parse.com/docs/js_guide)
There's more out there if you google Backend as a service.
If you are looking for something more simple, just need to take information and store it (like a form), then I would suggest looking at these services:
Wufoo (http://www.wufoo.com/)
jotform (http://www.jotform.com/)
Hope it helps!
I'm trying to build a "bookmark manager" for a browser,it should read data from an existing database on the user's machine.
I tried ST2 and it's proxy,it's explained here ,but it creates its own database,I can't get it to use an existing database.
I tried the sencha sqlite proxy ,it does the same,it's not even in their documentation
so i'm stuck again.
Is there any way to do this with Sencha?
Another question is : can I do this using just Javascript or jQuerymobile ,or any other library out there?
You can't connect to an existing DB. Think of the security issues if you could.
Edit: is local-storage an option?
Hii,
I want to retrieve data from sql database and display dynamically in div using javascript can anyone please help me on this...
Thanks...
You can not do that using only javascript, as sql queries should be done using server-side technology.
First, you have to find out what kind of web hosting do you have or can afford:
Web Hosting. Usually allows you to use PHP and MySQL.
Virtual Private Server, Dedicated Server. Lets you install anything you want on the host. But, it's usually 5-10 time more expensive.
I suppose you will take simple PHP Web Hosting, as it is cheaper and more avialable.
Here you go with a detailed beginner manual on getting data from MySQL with PHP and providing it to your page: http://www.freewebmasterhelp.com/tutorials/phpmysql
Generally, I can't give you more information than this, as it will same as writing a book on using PHP and MySQL. So I suppose you read that link I gave you, and open separate questions if you have some other specific questions.
If, by any means, you do not want PHP, then you should search for relative documentation.