i heard that the best way to connect android to sql server database is by creating web service around it. Is there any specific tutorial to create the web service?
Do we need install server like xampp for mysql or it will be just fine with sql server management studio?
What is exactly a web service? Connecting via post method to php is a web service?
What software i must use to make it work?
-android studio
-sql server management studio
-php written in notepad (?)
-apache tomcat?
anything else?
Sorry for bad english, Thanks
You gave us a very broad question.
I'll try to get you going.
First, a webservice can be a lot, but most often it is a server (php in your case) that uses SOAP.
Look up SOAP yourself to get the details, but it boils down to sending XML files to the server. The server then responds with something appropriate.
Here is a very short introduction with code, just to get the idea what it is about:
http://www.codeproject.com/Tips/671437/Creating-Web-Service-Using-PHP-Within-Minutes
The reason you want a wrapper around your database is this: You don't want to allow everybody to access your database directly. So you write a wrapper around it, that ONLY performs tasks you allow it to.
For example: Get all users in group x. Or: Update the birthday of userid 455.
etc. That way you control what goes in and out, and you only have to send some XML to get the job done. Your PHP script will take care of the actual database interaction.
Where you write your PHP in isn't very important. I would advice you to use at least an editor with syntax highlighting and UTF8 support.
Don't use Notepad.
Look up notepad++ if you want something better: Notepad++ can do that. If you take bigger projects you probably want to use a real IDE. (There are many for PHP)
Apache? Linux? Windows?
As long as you can run PHP, it is OK. If you are planning to use MSSQL Server from Microsoft, you will have an easier time if you run on windows. If you use mySQL, it doesn't matter too much.
I want to warn you: You seem to be pretty new to PHP (since you asked if Notepad is OK to develop in). This project might be a little over your head. :-)
Related
I'd like to get apache, mysql, and php running in an iphone app. This is because I'm finding objective c to be quite difficult, and if I can get those three running and figure out how to set up a full-page browser or something, I can code my app like that.
The MySQL aspect isn't really a necessity since I can very easily code a flat file database in php for this.
Is this possible? Has it been done? If not, what frameworks should I use to make creating an app easier?
I am assuming what you are saying is that you are more familiar with HTML and JavaScript, and would like to code with those tools.
If so, take a look at PhoneGap and Titanium. They are frameworks to code iOS apps with web technologies. Basically, it is like running a local file in a web browser (with interfaces to access device functions such as the GPS). No need to have a PHP and Apache stack there.
There is also a quasi-standard to write web applications that can work offline once downloaded. Mobile Safari supports this, and it can almost look like a native app.
If you're looking for any other options, there's Mono Touch, which is C# for iPhone. It's garbage collected, managed, strongly typed, and has access to all the device functions just like PhoneGap.
There's not really any simple way to get PHP running on an iPhone. You could try to get it to compile yourself, but that sounds like you'd be spending more time trying to get the framework working rather than working on your actual project.
I want to develop a desktop application using Adobe Flash remember a desktop not a web application. I want to connect Database (MySQL) to it for which I think I should use Php.
Can I send and receive data from Php files silently means without running the Php file itself.
Is there some method to achieve something like this?
Honestly it sounds like your best bet is going to be to use Adobe AIR. You can use the NativeProcess API to call PHP on the host computer, but you also have the option to use a SQLLite database directly from AIR with no need to mess with PHP.
Here's a link to a sample project with source code provided, this may help. Good luck!
http://www.peterelst.com/blog/2008/04/07/introduction-to-sqlite-in-adobe-air/
Is there some method to achieve something like this?
There are ways to package an Apache/PHP/mySQL environment into an executable, but they are terribly complex to set up and not especially light-weight.
You are probably much better off doing this on a native platform for desktop applications. Every major programming platform has the means to connect to a mySQL database - if that really is the database of choice for a desktop app.
Is there anything I can use to have PHP execute in a self contained environment without having to install server software?
haven't learned other languages :-(
I wanted to write a simple php/XML webapp that can be used on a desktop machine with no admin rights. It's for daily data entry stuff myself and others have to do when certain tasks are completed. Its a work machine and security is super high so can't have the details traversing the internet to my hosting.
Any suggestions?
XAMPP Portable might be what you are looking for. You don't need admin rights to run it.
http://portableapps.com/apps/development/xampp
Regardless of what language you use, in order to have a webapp, you need a web server of some sort, to listen to requests and send a response back (even if it's just listening to localhost). It is possible to run php from a command line without a server, but I don't know if you want to convert your application to a command line one.
Assuming you're using Windows, there are solutions for compiling PHP into an exe file (a quick google search found Phc-win, for example). However, I've never actually done this myself so this be sure to fully investigate what this would entail! You'd most definitely need to rewrite your views to use some way of creating actual dialogs in Windows (ie. WinBinder, or wbObjects).
(Of course, if you wanted to convert it to a desktop app the best solution is to actually use a language meant for desktop development, but if you only know PHP and don't want to spend the time learning something else, this could suffice, I guess.)
What is the best way to build a non web browser stand alone php app that works with some sort of database without requiring the user to install a database server. Or am i just asking too much?
If you're targeting Windows, try WinBinder. It allows you to develop native Windows applications using PHP.
It also supports SQLite, so you don't need a database server.
Embed the SQLite database in your app, then configure PHP to talk to the SQLite database:
http://us.php.net/sqlite
Have a look at php compilers, you'll end up with a binary for people to run. It could be a desktop GUI application, or a "web server in a box" type of thing.
bamcompile
phc
roadsend
I'd suggest you try miniPHP. It is basically an IDE around Winbinder; it lets you concentrate on writing PHP while it takes care of details like compiling the application. You can create either GUI or command-line apps and it works just fine with both SQLite and MySQL. It has a preview mode and some debugging capabilities too.
Here is an idea: information can be stored in XML and thus usage of database can be avoided. That will work only for certain kind of purposes of course.
As Oakcool has mentioned, check out PHP-GTK. It is a GUI development tool on the similar lines of MFC for C/C++.
PHP-GTK alongwith SQLite or a text file as others mentioned above should do the trick.
Take a look at this 3 links
PHP GTKenter code here
http://gtk.php.net/
FLEX
http://www.adobe.com/products/flex/?promoid=BPDEQ
AIR
http://www.adobe.com/products/air/
I think any those will help you, check it out.
I don't have any experience with it but there's a portable version of XAMPP.
You wouldn't necessarily have to use the Apache portion. The app could just run from the command-line, depending on what you're trying to do.
I dont know how to use PHP as standalone programming language, I mean without using a web server and a browser.i can answer your other question.
SQLite is a database system(to be more specific: a library!) which provides you all the basic capabilities of SQL database without needing to install any specific database servers.But you do need to copy a small .dll file(sqlite3.dll i suppose) into your working dirctory.The file is only a very small one,but you get all of the basic capabilities of a database such as INSERT DELETE UPDATE SELECT etc..Its a great light weight database..i mean it..really lightweight.
also PHP has inbuilt support for SQLite database.so compatibility will never be a problem
Have a look at their home page https://sqlite.org/
This is what they describe themselves:SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. SQLite is the most widely deployed SQL database engine in the world.
Checkout phpdesktop that gives you:
Embedded web browser based on Chromium framework let you benefits from HTML5, javascript and jQuery.
Embedded web server with mongoose let you use php.
embedded database engine with SQLite.
We have an existing windows desktop app written in C# 6 that uses an MDB MS access database for its storage. I need to write a web interface that can read that php webpage and maybe write to it later on.
This web interface will be included with our current installer for the application or as a simple addon. The user should only have to click start server and it should just work serving the php pages from the installation directory.
I was playing with gwan, nginx, quickphp. Only the last one seems simple enough to work.
So my question is what do or would you use to achieve this? Are there alternatives to quickPHP?
Distribution. I'd also like to have something we can include in the installer. I dont want the user to have to do and download any additional apps.
I know you said PHP, you also mentioned your app is written in C#.
You might want to take a look at aspnetserve if you are willing to write the web part in .NET. It might be possible to use PHP with it, but I don't know.
Either way I have found it very useful in several projects.
If you can live with other types of server side scripting than php, Microsoft's Cassini server looks like potentially a very good match (.net based, source available, small, ...).
Oddly enough it's hard to find a "canonical" url for it but Googling or searching here on SO brings back plenty of links.
Edit: an at first sight surprising feature may be that out of the box Cassini only seems to listen to localhost (127.0.0.1). However, as explained here,
Cassini only listens to localhost requests (for security reasons) -- it
uses IPAddress.Loopback in the code. You can find the code in Server.cs and
you can change it to IPAddress.Any to enable access from other machines. Of
course, you'd be opening up the port for outside access, so you need to be
aware of the security implications.
Or go with UltiDev Cassini
EasyPHP
Lampp
For a light-light-weight server without installation you can look at nanoweb portable. I am not sure how performant it is though.
Are there alternatives to quickPHP? The user should only have to click start server and it should just work serving the php pages from the installation directory.
G-WAN works like this (zero-configuration): scripts and "edit & play".
And G-WAN v3.10+ supports C#, Java and PHP scripts (all natively).