this is my first time using StackOverflow and I don't know how this works but I'll be quick and short. So, I'm in an internship and I'm learning Angular and I only know the basics. They told me to make a simple project so I can understand the basics of Angular by making a task manager and using as Database PHPmyAdmin and of course PHP language. I did the database and I'm using Postman to get the HTTP request as the company colleagues told me to use. I want to understand if it is possible to make the database connection to Angular and how.
No because there's no such thing as a "phpmyadmin database".
Phpmyadmin is a tool for interacting with a mysql/mariadb database management system which will contain one or more databases.
Meanwhile angular is a toolkit/framework/library for writing JavaScript code to run in a browser. Browsers communicate with servers using http. Mariadb and mysql don't speak http. You need to build something serverside to bridge the http to the DBMS. You appear to be using PHP serverside already for this but there are lots of other languages.
Related
I've built a web app using Sharepoint 2010 and was able to connect to a Sahrepoint list using REST API (ajax). THis method allowed to use a Sharepoint list as a database.
Now I am in the process of creating a web server with MSSQL. I havent dealt with MSSQL a whole lot to be honest. I know that the ideal way to access the database is via PHP but its not an option at this moment. So i'm trying to see if I can simply use jquery/javascript to get, update, create and delete records using AJAX.
Im having a hard time finding any info on this but would anyone know if MSSQL allows HTTP access liek Sharepoint's REST API?
I would imagine there might be a way to activate this function in MSSQL somehow but again, not finging a whole lot of noob guides or noob info on this. I would appreciate any input.
No, MSSQL does not natively host any RESTful APIs. You will need to use some kind of back end/server side code to actually make the database connection and run queries/return results.
You could use PHP (which is probably not the "ideal" for working with an MS product, but would certainly work), but you could also use a host of other server side languages - Perl, Python, Java, C#, C, C++, etc. and just expose JSON/RESTful methods for jQuery to interface with.
The "ideal" currently would be to look into oData services. Most likely you'd write an oData service hosted as a WCF service or ASP.NET site in C#.
See also:
http://www.hanselman.com/blog/CreatingAnODataAPIForStackOverflowIncludingXMLAndJSONIn30Minutes.aspx
how to query SQL Server via REST to get XML.
So I've built a web app in PHP that relies heavily on a MySQL database. Now (for user convenience purposes) I'm trying to create the exact same app, just as an iPhone app. Granted, I have no knowledge of Objective-C (just starting to learn it), I wanted to know how to go about this. I know that I'll have to use some kind of intermediary to get Objective-C to connect to the SQL database.
So essentially my questions are: If I've already created the web app as aforementioned, could I use the same DB and tables for the iOS app version as I did for the PHP web version? Also, is there anyway to migrate any code I've created in PHP to iOS (I realize that they are two completely different languages), but I'm just curious as to whether or not I'll have to build the iOS app from 'complete' scratch.
Your best bet is to write an PHP service to talk to your database.
This way you can share this API between your app or iOS app or any other type of client app.
The service will be responsible to receive request query the database and send responses in JSON format for example.
So to make things easier, you should not query the database directly from your apps, use a common web service.
You can use your MySQL database for any purpose because it is just data. The code that will show them will be different though. If you have no knowledge about Objective-C you should consider the web-app approach.
Here are a few helper links.
https://developer.apple.com/library/safari/referencelibrary/gettingstarted/gs_iphonewebapp/_index.html
http://gigaom.com/2010/02/12/how-to-create-an-iphone-web-app/
I want to connect a MySql DB with my android application.
However, I DON'T want to/CAN'T use PHP for doing this.
Almost all solution for MySql connection with android on internet uses PHP.
I read somewhere that, If one don't want to use PHP then web service should be used.
But I'm not able to find any tutorial/sample example for the same.
Any help appreciated.
It seems you're mixing up some things.
A web service is simply some code on the internet (web) which allows you to receive and send information to a server, where it is saved per example in a database.
PHP is just a language, in which you can write a web service.
You can use a vast array of languages to create a web service ( read: expose your database) to other devices. Among others, you can easily do this in Java, .NET, Python ...
If you're looking for a way to connect to an external database without any web service / API in between, i'll have to disappoint you with the news that this is not supported by Android.
Most examples of a simple web service / a bunch of scripts contain PHP since this is probably the easiest and can be used on pretty much any server.
A webservice, is as it's called, a service, meaning that you have one side consuming it (the android client). if all you want is a persistent storage, you could use SQLite which is an SQL compliant solution which exists within android.
If it's possible to SSH to a server via Android, you could use that to connect to mysql, because the only other solution involves having mysql binaries installed locally on your android machine, and that's not possible AS FAR AS I KNOW, on Android.
One major reason for using a webservice (e.g. written in PHP) to connect to a remote DB is that you don't want to store the database login credentials inside your app. Because otherwise it'll be easy to extract your login for that database and access and edit it in a way you might not have planned (eg. delete stuff).
Its Possible to connect mysql database .
I have done with out using php file . I have used an spring configuration file to establish an connection to the database and dao to access the data from the database.
Create an Web Application that access the Server through the Spring Framework and an Servlet .
Create an Android Client Application tat make an get / post request to the Servlet , process the results in the servlet and return the response to the Android Client Application (json format ) Process the json format reponse in the Android Client Side and use it to your application
I have found many places online that say in order connect to a remote MYSql database, use php. I do not know how to get from my iphone app, to php, to mysql and back. I cannot seem to find anything on the relationship of these things. I would really really appreciate any help in this matter. Where do I write the php code? Where do I call it? When do I connect to the remote server. I am new to this task.
please help
Thanks
To try and answer the question, the way this kind of access works is that you would create a web service with PHP code on a web server. This accesses the MySQL database. Your iPhone application would then make a request to your PHP web service and handle the results.
Perhaps you would find this tool of use. I'm involved in a project for allowing you to manage a hosted MySQL database, create a web service layer for it, and build a customised client library that helps you consume the results on the iPhone. The project has just gone into an open beta programme.
It's called Kumulos and it removes all the tricky, repetitive stuff associated with creating database driven apps. We're looking for beta testers and would love to hear your feedback!
You can take a look at the project here: Creating iPhone MySQL databases with Kumulos
I hope this has been of some use, thanks,
Chris
I'm creating a website using PHP and MySQL, and I'm trying to add some Silverlight stuff to the site. I need the users to be able to do stuff in the Silverlight app, and for that data to be saved in the MySQL database. I'm wondering about how I could do this...
Can I get the client side Silverlight app to log in to the server side MySQL database? Would this be a security risk? And if it's possible, how would I do it?
Or is there a better way anyone can think of? And any ideas how I'd implement it?
Thanks everyone! :)
No you should not have the app interact with your MySQL database directly. In this type of situation you will need to implement some form of web service, which exposes your data to the client. The Silverlight client code will then send requests to the web service, which runs on the server and has access to the database. Using a Microsoft technology on the server will make this a lot easier, because the IDE will do a lot of the wiring up for you, but I'm sure it could be done with PHP as well.
I would look into how to create a PHP, REST or SOAP based webservice and go from there.
Here is a video explaining how to consume the service, once you have that sorted out on the server.
http://silverlight.net/learn/videos/silverlight-videos/http-communication/