I was wondering if it is possible to use SQLite in PHP when the extension is not available (due to web hosting policy). Is there a pure PHP library for that?
Otherwise, is there PHP alternative for flat file database which I can adopt without going to MySql or MSSQL?
Try following the link pointed out by Andrei B: I published a link to my implementation of a database, entirely written in PHP, which aims at full support of SQL syntax. It's an open source project, every suggestion and contribution is welcome!
https://github.com/morepaolo/PHPFileDB
Check out https://github.com/mhgolkar/FlatFire or maybe stick with XML files (and related XML and XPath functions).
Related
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 written an app in PHP which outputs (and receives) RSS feeds.
I want to get the app to email when there is a new item in one of the feeds.
I am looking for an easy way for me to do this without storing contents on a database. Is there a script that does that? If not how is the best way of doing this?
I thought about storing the latest items for each feed in separate text files and marking them as sent when the email was sent. It seems a bit clunky, but might work. I am not sure of the best way to format the text file.
Any ideas would be appreciated.
I know that you're opposed to using a database, but not opposed to storing data in files. Perhaps you wouldn't mind using a database like SQLite.
SQLite databases are stored (and accessed) in files, it doesn't require any installation or a database server, just the file system. Read the linked page above.
It would be more efficient than just flat text files, and take you less time to set up. For a small simple application this could be the right solution.
You should use PDO as the database driver in PHP (not the SQLite class). It's enabled by default on most systems and won't require any edits to php.ini. Using PDO also makes it very easy if you want to switch to a MySQL (or other) database later.
From the installation manual:
PDO and the PDO_SQLITE driver is enabled by default as of PHP 5.1.0.
If the user has less than PHP 5.1 installed, then your script will probably be broken in another way. I find that most common users have 5.3.x.
Is it possible to write .MDF files using PHP. I have a simple HTML table - x columns, y rows that I wish to convert into a MS Access dataset. There are no foreign keys or anything exotic, just a number of rows and columns.
I have Google searched but the only advice I seem to be able to find is to save it as a .CSV. Unfortunately this isn't acceptable for my client. They want to simply be able to double click the icon and have the database load up in Access (Seems you have to import csv files and can't just double click them).
Those are actually two different problems:
1) Parsing HTML to separate values
Since you seem to have found a way to export to csv, I won't be answering this. You already got your parser then.
2) Create an mdb file.
You can use odbc to talk to Access, that is, if you are in Windows. That means that PHP must be installed on a Windows machine. I'm not aware of any Linux drivers for Access..
You can use odbc_connect to connect to the database:
$conn = odbc_connect("dbname","" ,"");
From there, working with the database is pretty similar to MySQL as long as you use the ODBC functions.
The only problem is creating the actual MDB. This cannot be done in ODBC, you'll need the JET engine. It may be possible to create an MDB file from PHP, but it may be easier to create an empty MDB once, and copy that file from PHP whenever you need a new database.
Jackcess is a pure Java library for reading from and writing to MS Access databases. It is part of the OpenHMS project from Health Market Science, Inc. . It is not an application. There is no GUI. It's a library, intended for other developers to use to build Java applications.
http://jackcess.sourceforge.net/
But an MDF file is not a standard Access file extension. MDB and MDE are while MDW is for user level security.
Have not tested this but this might help you:
http://devzone.zend.com/article/4065
Note that active development of MDB Tools has moved from Sourceforge to Github
https://github.com/brianb/mdbtools
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
Hai frnd can give me some solution..
1.how to open ms word document without using com(word.application)
2.actually i want to edit existing document only changing content without affecting any properties?
Zend_Service_LiveDOCX is a solution that doesn't require COM. It uses a web service.
See this PHP tutorial.
You can use NPOI. It is .NET port of the POI library. I used it for excel but guess should work for word as well.
This probably isn't much help because you need a solution now:
PHPWord currently only writes and only to .docx files. It is still in the early stages of development, but is worth keeping an eye on, and readers will be forthcoming in due course, as will support for .doc.