This is a pretty straightforward question: is there any way of creating an MS Access database file from scratch using PHP? I strongly suspect the answer is no out of the box (using PDO with the ODBC driver pretty clearly demands an existing file for the connection string), but perhaps there’s a library I haven’t found. Currently I’m using an empty .accdb file as a template and making a copy before CREATE-ing tables in it, but I’d like to skip that step for security reasons if nothing else.
You can't, because the ODBC driver needs a database(!) to connect to.
Your current approach, copying a template file, is clean and simple and, except if the file can be replaced, also safe.
I have not found a library that handles exporting data and structure to SQL. - there are a number of snippets and so on for data only. Exporting structure seems quite a bit more complicated. It must be able to do this without command-line access.
Many of the descriptions I've found online are quite old, so perhaps MySQL has new features that handle this? Or perhaps there are now libraries which do this? (Or perhaps PHPMyAdmin has a self-contained class or set of functions I could hijack?)
You could try this: Sypex Dumper
I used it for a long time with Joomla on XAMPP, very light weight and functional.
You can simply use it standalone or integrate to your application.
This class suited my needs
https://github.com/2createStudio/shuttle-export
You can see several examples in the documentation. The only flaw is that this class don't have the force download option (it always generate the file in disk). I was willing to make a pull request, but there's one push request dating from 6 months ago and the mantainer didn't give a dam.
I have a small mySQL database and a few simple php based webpages that query the database, generate html tables and present them in the browser. The database is no longer being updated. So, searching and viewing subsets of the data is all that is required.
Some users are interested in distributing the searchable database on a cd or usb memory stick. SQLite seems to offer the answer, but I don't understand what is needed to make this work. What will be required to make a web browser based "app" work from a memory stick in the absence of a server like xampp?
XAMPP Lite from http://portableapps.com/apps/development/xampp
What you want is called a "standalone server". This is very common in almost every other modern language except PHP, for some reason. Googling "standalone php server" reveals several options:
QuickPHP
Nanoweb
Server2Go
Is there a php editor on the market witch can read sources straight from a mysql database?
No....and maybe.
There is no reason why anyone should write a MySQL based editor.
Your best chance to archive this is to find a greedy and/or lunatic programmer that will write you a MySQL-virtual drive.
Yes this IS possible, and at least on windows it does not take much skills.
Well, you could use one of the existing php online editors, and hack the Horde VFS backend in, allowing you to read local files or a database file storage. Another alternative was writing your own FUSE driver. Most sensible however would be to make your database contents available over WebDAV, allowing you to use Eclipse or so
I have developed a PHP-MySQL web application, which is a school-based project.
My client wants this application to be converted into a .exe file such that it can be installed on his desktop and use it.
How the PHP website can be converted to a .exe file and can it be run without the need of a database/server software?
Please advice.
The convenient solution is not to convert the website to .exe. I think it will be better if you have portable server/php/mysql and make the website work from a usb or CD with autorun.
NuSphere's PhpDock claims to do this: It serves as a deployment helper and comes with a bundled web server. However, I don't know about the database part, and it's not free.
PhpDock enables you to deploy any PHP web application as a Stand Alone Windows Desktop application w/o any changes in the code.
I don't know that particular product, but I have been using their IDE for years and am quite happy.
try using a site-specific browser. it will make a desktop app that is basically a portal running to your webapp. try this one:
https://mozillalabs.com/prism/
It allows alot of advanced features like system tray icons and such. I have used it many times!
Hope this helps, JL
Short answer: Not possible.
Long answer: It depends.
You could install a web- and database server on his machine (or create an installer that does it) and run the application locally on his machine.
or
You keep the application on a server and just provide a launcher that opens his browser and points it to the URL of the application.
As Artefacto mentioned, it might be a good idea to switch to SQLite instead of MySQL but depending on how your application is written it might require a lot of code and SQL Query changes.
No. You have at least to remove the dependency on MySQL (and use e.g. sqlite instead).
Then, you would either have to:
Convert the webpages to windows dialogs. This would completely change your application (e.g. what would originally be http "form submissions" would be someting completely different). At this point, it'd much easier to write a .NET application
Bundle a web server (e.g. Apache) with PHP installed.
Another try would be to turn your php project into PHP-GTK (http://gtk.php.net/).
Yet another one is to give HPHP a try (https://github.com/facebook/hiphop-php/wiki/) and try to turn the generated C code into something like a .DLL in .NET and use it for the logic while coding the UI in say, C#.
Just create a simple program in C or C++ that will just add icon in Start menu, desktop and Quickstart. If your client clicks the icon it will open the default OS browser and point it to URI of your application online.
That might fool your client :)
Or maybe it will be enough for him (he might be asking you to convert it to exe because he can't remember URI or something - ask him what is the reason).
You can use xampp open-source project to pack your PHP site into an executable file.
Use the following steps:-
1. Download Xampp source code.
Add your PHP file inside htdocs directory(Ref:- https://sourceforge.net/p/xampp/code/HEAD/tree/win32/xampp/htdocs/).
Now compile the XAMPP source code and distribute it.
For DATABASE creation and initial data loading in the database, you can code your site in such way that if database is not created, it redirects the page to install.php which do the database creation and data loading task using sql file provided(you need to add SQL file containing database structure and required data).
Don't forget to delete the SQL file post installation of database.
Not sure that's gonna be possible but have a look at:
WinBinder
WinBinder is a new open source
extension for PHP, the script
programming language. It allows PHP
programmers to easily build native
Windows applications.
(source: winbinder.org)
Solution 1:
There are several solutions to convert your web application into a desktop application, the one I prefer is the open source solution: PhpDesktop, but unfortunately it only supports SQLite.
Best Solution:
To convert your PHP application with MySQL I know a paid solution that does this: 'ExeOutPut For Desktop', it is the best for this job
Php desktop is the way to go, it's actually very simple to modify to the version of PHP you want to use and is open source too https://github.com/cztomczak/phpdesktop