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.
Related
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. :-)
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 have an idea for a product that I want to be web-based. But because I live in a part of the world where the internet is not always available, there needs to be a client desktop component that is available for when the internet is down. Also, I have been a SQL programmer, a desktop application programmer using dBase, VB and Pascal, and I have created simple websites using HTML and website creation tools, such as Frontpage.
So from my research, I think I have the following options; PHP, Ruby on Rails, Python or .NET for the programming side. MySQL for the DB. And Apache, or possibly IIS, for the webserver.
I will probably start with a local ISP provider for the cloud servce. But then maybe move to something more "robust" and universal in the future, ie. Amazon, or Azure, or something along that line.
My question then is this. What would you recommend for something like this? I'm sure that I have not listed all of the possibilities, but the ones I have researched and thought of.
Thanks everyone,
Craig
If you want a 'desktop component' that is available for you to do development on whenever your internet is out, you could really choose any of those technologies. You can always have a local server (like apache) running on your machine, as well as a local sql database, though if your database contains a large amount of data you may need to scale it down.
Ruby on Rails may be the easiest for you to get started with, though, since it comes packaged with WEBrick (a ruby library that provides HTTP services), and SQLite, a lightweight SQL database management system. Ruby on Rails is configured by default to use these.
The languages you list are all serverside components. The big question is whether you can sensibly build a thick client - effectively you could develop a multi-tier application where the webserver sits on the client and uses a webservice as a datafeed if/when its available but the solution is not very portable.
You could build a purely ajax driven website in javascript then deploy it to the client as signed javascripts on the local filesystem (they need to be signed to get around the restriction that javscripts can only connect back to the server where they served from normally).
Another approach would be to use Google Gears - but that would be a single browser solution.
C.
If you wan't to run a version of the server on desktops, your best options would be Python, Rails, or Java servlets, all of which can be easily packaged into small self contained servers with no dependencies.
My recommendation for the desktop would be HTML 5 local storage. The standard hasn't been finalized, but there is experimental support in Google Chrome. If you can force your users to use a specific browser version, you should be OK, until it is finalized.
I would recommend looking at Django and Rails before any other framework. They have different design philosophies, so one of them might be better suited for your application. Another framework to consider is Grails, which is essentially a clone of Rails in the groovy language.
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.
I'm new to Flex and done a few application with only client side programming. Now I'm trying to do the back-end stuff using PHP. Can some one explain where(which folder) to put the PHP file for the Flex file to communicate with PHP. I'm using Flexbuilder 3 IDE.
Thanks
Flex will not access your PHP script via the filesystem, you have to invoke your PHP script via a web server. The easiest solution is to use XML as in your data transport language. But you can get fancy and use something like BlazeDS
This all really depends on what you want. I would make a very different recommendation if you wanted to simply poll the server occasionally than if you wanted to have a regular interface between the two.
If you are simply polling the server, I would recommend simply using the HTTPRequest class. It will allow you to create POST and GET data and serve to communicate relatively well.
On the other hand, if you are looking to have a more complicated set of communications between the server and the SWF, your best bet is the RemoteObject class with either AMFPHP, WebOrb, or an equivalent (we use WebOrb where I work). This has the benefit of allowing you to have objects of similar name/type in both Flex and PHP, meaning that communication can be made a good deal more comprehensive.
(If you are working this way, email me cwATallen-poole.com and I can give some pointers so that you do not have insane compiler arguments for Flex).
The next option is to use the XMLSocket class, but that seems to be a bit more intense than what you are looking for.
You may want to take a look at AMFPHP too, pretty handy.
Try XAMPP.Very useful.
The new Flash Builder 4 (product formerly known as FlexBuilder) supports connecting to PHP services out of the box. The use the Zend Framework to do it, and will install the framework to your test webserver for you whenever you go to setup a data service.
Adobe video tutorials:
Part 1
Part 2
Another good, non-video tutorial