Reading from a databse in AngularJS - mysql

My question is a simple enough one but I can't quite seem to find a good tutorial on it. Maybe I am not being specific enough with what I am asking but I can't really type an explanation into google and expect an answer.
So here is my question;
I currently have a website up and running on a hosting site and this hosting site allows me to have a database up on their server as well.
So my question is how do I read data from this database that I have setup using phpAdmin? Also, it is a mySQL database.
The website will be acting like a review site built I just want to use it to learn web development as well. So What I am trying to do it read articles that I will be saving in the database so I can display them on my website.
Any help or advice in regard to this is much appreciated.
Thanks in advance,
Cylon.

you cant read directly from a Database using AngularJS or any Client-side framework , you need a back-end / server-side language such as PHP ,C# ,Java..
to connect to your MySql ,MSSql... ,
so in your case your need to create PHP script which will connect to the Database and provide an interface you can access with (GET , POST methods ) using AngularJS ($http.post("url"...)
for a best practice (if you want) the Data should be in JSON format.

Related

How can I connect my react native app to MySQL server?

I'm creating a mobile app for an existing website and trying to connect to a local instance I have running on a MySQL workbench. I've seen others recommend against the use of MySQL but I'm stuck with it, since that's the current database. I'm using expo to run my React Native code. Do I need to use a server, like "MAMP?"
Let me know if there is any more info that is needed.
You cannot connect your app directly to your database.
You will need a server/API that acts as an intermediate between the app and the DB. You can code it in most programming languages and if you know PHP, having MAMP on your system will allow you to build your API with PHP.
I've seen others recommend against the use of mySQL
You should definitely question their reasoning. I've been using MySQL for many years now in small and big projects and it has never been an issue. If they're comparing it to non-relational DBs like Mongo, I can understand, it's easier to setup and maintain a NoSQL database than a relational one.
I assume you're not that experienced but I still purposefully used some terms that may be new to a beginner. Since I don't know your skills, I will refrain from pointing you to specific tutorials/articles.
I recommend you to Google anything you don't understand from this answer.

Is there a way to embed or include a database file into an html file? If not is there another way I could do something similar?

I'm trying to make a website for an assignment. In this assignment, I have to include examples of some of my work and I want to include a database I made in Microsoft Access, is there anyway I could do this? It preferably has to be in html. The database is just a table, a form and a report.
HTML can't to connect to database alone, you should to use other tecnology together to this be possible, a better way to do it in a web system is to connect through a API, if not know about, google it, have a lot of documentation and tutorial to make modern restful API, for your case that is using microsoft access I found this Microsoft tutorial maybe can help you.
-> https://support.microsoft.com/en-us/help/308459/how-to-connect-an-html-page-to-a-microsoft-access-database

Is it possible to write mysql queries in Angular.JS?

Im new to Angular.JS and just wondering if it is possible to write mysql queries in angularjs?
I would like this as I am trying to create a messaging system in which I query the database and get the information live to the webpage.
Any help is appreciated, hope the question is reasonable. Gab
That is not advisable (if possible at all) as it would defeat the purpose of Angular.
You should consume data by targeting a RESTful api/service exposed by the server. The service would handle the DB access for you and provide the data to Angular using a more portable format (e.g. JSON or XML)
Some of the basics of linking Angular and REST are described here
There are related questions on SO about exposing your particular DB flavor using REST here.
This can only be a starting point but it should give you some ideas. I will try to amend this with more info as I come across it.

Connecting visual c++ to an online database

I am working on an app in visual c++ which requires data to be accessed from a database which can be edited so that every time there is a modification to the data I do not have to resend the app as it will automatically update, it is also required that this is a desktop app.
I am currently using MySql however for this to run constantly I will be needing a server which for a single simple app wont really be worth purchasing, so I started thinking of alternative methods and thought to myself there must be some method of reading directly from a website or online database, am I correct in thinking this? If so could someone please explain how I would achieve this?
Also, I have purchased phpmyadmin in the past so if there is any way I could connect my visual c++ app to a database from this then that would be great.
EDIT: Note, this app relies almost entirely on the database as it is just 3 combo box's and one text field all of that values for which come from the database.
The following response is assuming that by online you mean on the web.
You cannot exactly 'connect' to an online database with C++ (or anything outside of that server hosting the database).
What I would do is create some PHP API's that you can POST to with libcurl via C++. You can both send and receive data this way.

Sending a request to retrieve the data from Django

I am doing a Web project, where I am using HTML5 and Django to store database in sqlite3. The part being, since I had to use python, I installed mod_python for apache2. Now the thing is I went through many sites for head start to store the data and retrieve it. When I check in google related to how to use mod_python I did get certain information on how I can send a request to a .py file and then execute it. But with Django documentation providing a tutorial which is to develop a polling webApp, I am not finding it measurable to the part I am trying to achieve.
I want to send the request from an Html file where I have a search box and some radio buttons, to Django through Apache2 (mod_python) and then access my database in sqlite3. Please could anyone give me brief idea on whether I am doing it right? Also if yes, can u give me a hint as in how can I send the request from HTML file to the database from Django and mod_python being used? I am a bit confused with Django tutorial.
Please if anyone can just let me know what exactly I should do! Or if any link with a proper guidance would be of great help.
Thank you.
Well, for starters, if you can install and use mod_wsgi instead of mod_python, you should -- mod_python hasn't been supported for years. I'd also strongly recommend that you use anything other than SQLite for a production web application -- SQLite doesn't cope well with multiple simultaneous transactions.
If you're stuck using mod_python, then see the Django documentation for using mod_python.
Once you've got that working, the rest of your questions can be answered by the Django Tutorial, particularly part 4, which covers the use of HTML forms with Django views and templates:
http://docs.djangoproject.com/en/1.3/intro/tutorial01/
http://docs.djangoproject.com/en/1.3/intro/tutorial02/
http://docs.djangoproject.com/en/1.3/intro/tutorial03/
http://docs.djangoproject.com/en/1.3/intro/tutorial04/