Connecting MySQL Database with Google Chrome Extension? - mysql

Is it possible to do this?
I'm familiar with MySQL when it comes to webapps, but I'm learning how to create google chrome extension, and I'd like to somehow connect to my database from existing web app. I have created a form in the popup.html from google's example, and would like to send input values to a script to insert data into MySQL when user submits this data. How would I do that?
Right I'm in developing stage and uploading chrome extension is easily done without uploading to my server. So I'm just wondering how I can connect MySQL database if its not localhost?
Thanks!

I think what you don't want to give your chrome extension access to the database. That's a security nightmare of biblical proportions.
What you want to do is create a remote web-service that the extension can talk to, that then handles your database operations.
This can be as a PHP script that you call that returns a quick bit of JSON, or vastly more complex.

Related

How to access an existing database file through html5?

I'm working on an desktop app(hta) that need to access information from a database.
My challenge is that already I have the data I need in a sqlite database file. I just want to access this database file from my app then manipulate and display the results to the users.Is it possible to deploy an app like this? I'm not finding a way to access an existing database file through html5.(The sqlite database file will be created during the app installation.It is present in C:\filepath)
The solution will depend on your use case. I can see two of them.
1. Your application runs in disconnected mode (standalone)
HTML5 provides an API called Web SQL Database. It enables you to access an API for storage in the web browser. It's pretty much build around SQLite features. However, all the web browsers do not support it.
2. Your application can access a remote server
In the case you have a remote database, and your application is allowed to access it, I would suggest that you connect to your database by making requests to it. Of course, you will require to develop your own little API on the server side to access the database e.g. via XmlHttpRequest.
You can use javascript to access Web SQL databases. Remember, Web SQL is deprecated and only supported in Chrome and Safari. And Web SQL isn’t even actually part of the HTML5 specification.
For a starter's guide: HTML5 Doctor: Introduction to Web SQL Databases

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.

iOS and Mac OSX communicating with MySQL database

I have a client who wants a control panel for the app I am developing them. The control panel is a Mac OSX application that allows the user to submit files (excel docs and such) to my MySQL database. Those files are then checked by the iOS app I have created for them.
I have no idea how to do this. I have the MySQL database all set up, and I have looked everywhere for a solution. Any help is appreciated.
I wouldn't try to connect to your MySQL database directly from your cell phone. It's a bad design for several reasons. Instead build a API on the same server as the MySQL database. It doesn't matter if you do it in java, php, c# or anything else. You might even find some product or open source project that can do this automatically. I've listed some benefits of doing it this way
It makes testing easier. You can write a test framework against your API that doesn't rely on or is using a phone.
It makes development faster. You don't need to emulate or use a phone to develop and test your table design and queries.
It gives you compatibility. When you need to change your database (and you do) you can create new APIs that the new version of the app uses while and old version still out there can continue to use the old API (that you might have to modify to still provide the same functionallity)
It gives you flexibility. If your user base grows and you might need to have replication for reads or sharded databases you build that into the API instead of into the app which is just a better way to do it.
One option would be to use PHP to handle all the database interaction.
Host the scripts on the server and just have the apps call them and get the scripts to return some sort of parseable response (I'd go for JSON).
I have never found a suitable Object-C based connector for MySQL. At this point I would suggest using a C/C++ connector. There's lots of examples of how to configure the connector for both C and C++. The hard part will be all of the data passed from the MySQL code and the Object-C code will that it will have to be in C types.
EDIT: An Example

Database Web Frontend

I'm looking for a web frontend for end users of our database (server runs either MySQL or PostgreSQL) for organization-internal contacts and order handling.
I've searched the web for free/opensource database web frontends but only found admin tools (phpMyAdmin, ...) and frameworks that only show the tables but you cannot create apps (dadabik, vfront, xataface).
I want to create apps like in Access forms but apparently there is no such tool out there... As a backup, I would use openoffice Base with JDBC connection or progam the frontend in PHP manually.
An advantage would be user authentication (preferably LDAP).
Any suggestions? Thanks in advance.
Take a look at OpenXava this might be what you are looking for.

How to have Android App communicate with external MySQL db

I am really confused on how to get data in and out of an android app from the internet.
I imagined that I would store information in the mysql db on the server I already have set up. But from what I have read, I would need some type of in-between web service to make queries with data sent from the app.
Can anybody toss me some tips on how to get something like this started.
Or, if you know of a better way, let me know about it.
This question has been asked several times, for example here: How to get from a MySql server to an Android app?.
Bottom line - you don't connect directly. You have something on your server (like RESTful) that you connect with via HTTP.
Try this method out. I will be using this method for the current project i am working on.
You basically create a php script on a server and use http posts to send the data to the script, read the tutorial linked below for better explanation.
mysql/android tutorial