Access database with reports to multiuser web interface - php

I have a client that ask me to convert an Access database to something web based.
The database has 20 tables, 10 input forms (input of data is not done directly into tables), about 100 queries and 20 reports.
I don't mind using mssql/c# but I would prefer using php/mysql.
The client would like to have the ability to create himself custom report like it's possible in Access (WYSIWYG interface to select tables and fields and possibility to add header, footer, labels, etc.).
The solution can be something licensed but I would need something flexible as this is the first step of a bigger project.
Thank you very much in advance for your ideas/help.

Just convert the DB to Mysql and use an odbc driver to link access to the mysql db for report creation, what is the issue?

Maybe this tool or this.

Related

Creating a form based PHP application from scratch

I am interning for a company that manufactures parts and has to run a number of tests for chromaticity, brightness, contrast, ect. Currently, they are using MS Access as a front-end to input their data, which is then printed out as a report when they are finished. The data is not stored anywhere. Also, for some reason they have also created these "data forms" using excel which also do not store the data anywhere. It is my job to find a solution that will allow them to store all of their data in a mySQL database for later use, however, since they are using multiple UIs to input the data, I am unsure what to do. I have already come to an agreement with my superiors that they need to merge into a single UI, so...
Here are my options:
1) Attempt to link their already functional MS Access UI to my mySQL database (which could be a horrendous failure since I know nothing of Access), and convert all excel forms to Access forms
2) Convert their Access forms into Excel forms and then have to deal with capturing data from excel which is an extremely tedious coding job since there are about 50+ cells I need to capture in each of there hundreds of documents.
3) Create a PHP application that will allow an administrator to add attributes and define fields which will create a form and corresponding mySQL table for that form. Basically, taking the capabilities of the Access form builder/ forms and putting them into a web application. Would this take very long to do so from scratch?
Sorry, this was long, but I am the only one with programming background here and am just an intern, haha, so I need some advice.
Thanks
Matt
Approach number 3 could be done quickly with Symphony CMS. You would create a section for each form, and then you (or an admin) would add fields to that section using Symphony's GUI section editor. The form would then be available in the CMS, and ready for adding entries with.
Symphony CMS is very flexible, and you could generate reports (HTML or other formats) using it. It also has a RESTful API.
There'a also a CSV importing extension, which might be good for your Excel data.

Displaying results of many sql queries without writing PHP code?

Sorry if this question might sound stupid to you guys, but am total newbie to programming, apart from knowing SQL, the thing is i have been given a MYSQL database containing various information about kids diseases and a web interface written in php to create reports from the database that can be accessed via the interface. there are almost 25 different variables that need to be computed in the report, i have written sql queries to compute all these values, but i don't know anything about PHP, if i have all these queries isn't there a way for me to combine all these sql queries to be display results on a webpage and come up with this report without writing PHP code?
Thanks for your
again very sorry if this is too basic.
As mr_jp suggests, phpmysqladmin provides a simple front end for running queries, but also changing the data and modifying the schema. Although you can restrict named users to only have SELECT privilege, they'll still need to know SQL to run the queries.
It's not that hard to build a front end to take a set of parameters, substitute them into a SELECT statement and send the output to a formatted table. There are lots of datagrid tools (e.g. phplens, phpgrid, have a google for 'mysql datagrid' for more) which will handle the formatting of a MySQL resultset (or just download it as CSV - your browser should be able to transfer the data into your spreadsheet program automatically).
There are a couple of report generators for PHP - but the last time I looked at this in any depth, I wasn't overly impressed.
Your web host would probably have phpmyadmin installed. Try getting access from the web host.
You can enter your queries there and export the results as html, csv, excel and others.
You could write Python. Or Ruby. Or something you know. ;-)
But you need something to output your queried data.
If you just want to check the results by yourself without having the needs to publish that directly, you might use some MySQL query browser or administrator like phpMyAdmin or the MySQL Workbench. Those tools allow you to query the database but display the returned data only as raw tables. If you need some styling or your own layout, you'll have to use an own application or edit the exported data manually (e.g. using a CSV export and re-open it using some spreadsheet application like Excel or Calc).
The combination PHP + MySQL is a very popular one and it's highly recommended that you use them together.
The code that you will need to write in order to display that information using PHP is pretty straightforward and not very hard. If you do know some basic programming concepts, you can learn to do that in a matter of hours. PHP is well known for its extremely accessible learning curve. There are thousands of code samples online that you can look at to see how this is done.

Good alternatives/practices to "LIKE" with PostgreSQL and PHP?

I'm working with a Postgres database that I have no control over the administration of. I'm building a calendar that deals with seeing if resources (physical items) were online or offline on a specific day. Unfortunately, if they're offline I can only confirm this by finding the resource name in a text field.
I've been using
select * from log WHERE log_text LIKE 'Resource Kit 06%'
The problem is that when we're building a calendar using LIKE 180+ times (at least 6 resources per day) is slow as can be. Does anybody know of a way to speed this up (keep in mind I can't modify the database). Also, if there's nothing I can do on the database end, is there anything I can do on the php end?
I think, that some form of cache will be required for this. As you cannot change anything in database, your only chance is to pull data from it and store it in some more accessible and faster form. This is highly dependent on frequency of data inserted into table. If there are more inserts than selects, it will not probably help much. Other way there is slight chance of improved performance.
Maybe you can consider using Lucene search engine, which is capable of fulltext indexing. There is implementation from Zend and even Apache has some http service. I haven't opportunity to test it however.
If you don't use something that robust, you can write your own caching mechanism in php. It will not be as fast as postgres, but probably faster than not indexed LIKE queries. If your queries need to be more sofisticated (conditions, grouping, ordering...), you can use SQLite database, which is file based and doesn't need extra service running on server.
Another way could be using triggers in database, which could on insert data store required information to some other table in more indexed manner. But without rights to administer database, it is probably dead end.
Please be more specific with your question, if you want more specific information.

ODBC: when is the best time to create my database?

I have a windows program which generates PGP forms which will be filled in later.
Those PHP forms will populate a database. It looks very much like MySql, but I can't be certain, so let's call it ODBC.
And, yes, it does have to be a windows program.
There will also be PHP forms which query the database - examine which tables and fields it contains and then generates forms which can be used to search the database (e.g, it finds a table with fields "employee_name", etc and generates a form which lets you search based on employee name.
Let's call that design time and run time.
At design time, some manager or IT guy or similar gets to define the nature of the database and at runtime 1) a worker fills in the form daily and 2) management can extract reports.
Here's my question: given that the database is defined at "design time" (and populated at run time), where and how is best to do so?
1 I could use an ODBC interface from the windows program, but I am having difficulty finding something good to work with Delphi. Things like ADO and firebird tend to expect you to already have a database and allow you to manipulate it, but I can find no code example of how to create a database and some tables, so ...
2 I could used DOS commands from Delphi in my windows program. I just tried and got a response to MySql --version, but am not sure if MySql etc are more interactive. That is, can I use a script file or a very long stacked command with semicolons and returns separating? e.g 'CREATE DATABASE db; CREATE TABLE t1;'
3) Since the best way to work with databases seems to be PHP, perhaps my windows program could spit out a PHP page which would, when run in a browser, create the database.
I have tried to make this as uncomplicated as I can, but please feel free to ask questions. It may be that there are several valid ways, but there is probably one 'better' solution in terms of ease of implementation or maintenance.
Better scratch option 3. What if the user later wants to come back and have the windows program change the input form? It needs to update the database too.
Creating a database is usually a database administrator task. Unless it is a local database, maybe an embedded one, the user would need to know where and how create the database on the remote server, and she can have no clue about it. Where to store the database files? Which disks are available? And there could be many more parameters to set (memoery buffers size, etc.), users to be created and so on. And also you need very elevate privileges to be able to create a database, not something you give to average users or applications.
Thereby usually you ask the database administrator to create your database/schema, he will give you the credentials you need to connect, and then your application (or its setup) will create and initialize the needed objects (tables, etc.). Creating table (and other object) is usually as simple as running "CREATE TABLE...." statements. Just remember SQL takes one command only, if you need to run several commands you have to send them one after another yourself, although there are Delphi components which are able to split a script in commands and run one after another.

How do I handle multiple datasources?

I am working on a web application (PHP + Doctrine + MySQL) to sell. The problem is that there is information that the clients will need from my central data source and they will have information that they don't want me to see (financial and such).
My Question, what is the best way to get that information to the customer application?
My Initial Thoughts:
The application I am creating is built with Doctrine. I think I can create a connection to two databases by using something like (let me know if you know exactly how to do it):
$this->setTableName('host.dbname.tablename');
The problem with this is that I would have to open up the MySQL port, which a hosting company may not do for me nor may it be safe. Let me know if this is not so.
So I thought about setting up a php-cron job that will download the new data every day (daily would be sufficient). This would require some sort of php page on my data source to output the files. The problem with this is figuring out what information the client app has and updating it.
Edit: I just read about Federated Tables. This may be another solution if I can get the host to open port 3306.
Thanks
Create a view at the finance database to the table in question, then create a federated table at your web source database based on that view. If all you're going to do is read, then your web user only needs SELECT privileges.

Categories