Hi,
I have a project where I would need to use information from a database for use in Flare. Is there a module, or other tools i can use with Flare to query an external database and to put the query result as content to be used in Flare.
For example, the machanical division of company X produces different versions of a product. The product has some technical specifications, dimensions, etc... The mechanical department is responsible to fill in the database with all specifications, etc...
The product comes in different flavors. Flavor A with Spec A, Flavor B with Spec B, etc...
I want to produce one manual for the different flavor of the product. I would like to be able to use something to query the database for the specifications, put the query results in some variables' values, and produce the different manuals with Flare.
I hope this is clear. If someone knows how I can do this, please let me know.
By the way, I am aware of the different 'server' integration such as Sharepoint. I do not want to use a pdf from Sharepoint or something like this. I want to 'build' my own content using database queries. This would save a lot of manipulations.
Thanks,
Pascal
Querying a database for content
-
- Senior Propellus Maximus
- Posts: 4293
- Joined: Thu Feb 02, 2006 9:29 am
- Location: The Electric City
Re: Querying a database for content
You can do that with PHP. Embed PHP code in the page to connect to the database and query the tables, then prepare the results for output.
New Book: Creating user-friendly Online Help
Paperback http://www.amazon.com/dp/1449952038/ or https://www.createspace.com/3416509
eBook http://www.amazon.com/dp/B005XB9E3U
Paperback http://www.amazon.com/dp/1449952038/ or https://www.createspace.com/3416509
eBook http://www.amazon.com/dp/B005XB9E3U
Re: Querying a database for content
Thanks Ramon... that was fast!
when you say:
how do you put the query results in a variable value?
Thanks again.
Pascal
when you say:
could you share some PHP code examples?RamonS wrote:You can do that with PHP. Embed PHP code in the page to connect to the database and query the tables, then prepare the results for output.
how do you put the query results in a variable value?
Thanks again.
Pascal
-
- Senior Propellus Maximus
- Posts: 4293
- Joined: Thu Feb 02, 2006 9:29 am
- Location: The Electric City
Re: Querying a database for content
An example would be this:
http://www.w3schools.com/php/php_mysql_select.asp
That queries a table and spits out the results. That said, this will work only for online output and in that case you really do not need to inject that into a variable because the query results are generated dynamically each time the page is called up. While custom code like this is not unusual it is not a trivial copy & paste.
If you want to create printed/printable output my suggestion will not work and I cannot think of any easy means that would grab the query results and inject it into a variable that then gets used during output.
How frequently do tech specs change? If this happens only once in a while then a low tech copy & paste might be the easiest means to get the content in place.
http://www.w3schools.com/php/php_mysql_select.asp
That queries a table and spits out the results. That said, this will work only for online output and in that case you really do not need to inject that into a variable because the query results are generated dynamically each time the page is called up. While custom code like this is not unusual it is not a trivial copy & paste.
If you want to create printed/printable output my suggestion will not work and I cannot think of any easy means that would grab the query results and inject it into a variable that then gets used during output.
How frequently do tech specs change? If this happens only once in a while then a low tech copy & paste might be the easiest means to get the content in place.
New Book: Creating user-friendly Online Help
Paperback http://www.amazon.com/dp/1449952038/ or https://www.createspace.com/3416509
eBook http://www.amazon.com/dp/B005XB9E3U
Paperback http://www.amazon.com/dp/1449952038/ or https://www.createspace.com/3416509
eBook http://www.amazon.com/dp/B005XB9E3U
Re: Querying a database for content
Thanks again Ramon.RamonS wrote:An example would be this:
http://www.w3schools.com/php/php_mysql_select.asp
That queries a table and spits out the results. That said, this will work only for online output and in that case you really do not need to inject that into a variable because the query results are generated dynamically each time the page is called up. While custom code like this is not unusual it is not a trivial copy & paste.
If you want to create printed/printable output my suggestion will not work and I cannot think of any easy means that would grab the query results and inject it into a variable that then gets used during output.
How frequently do tech specs change? If this happens only once in a while then a low tech copy & paste might be the easiest means to get the content in place.
We are trying to automate this task as most as possible. This would, amoung other things, reduce the risk of cut and paste errors. I don't see this 'problem' as a frequency problem, i.e, it is not because we change frequently the specs. It is the number of specs involves and the possibility to fill in the table automatically with the specs, right from the source, thus reduncing risk of errors in the process... hope my precision helps understand my goal.
Except 'esay way' of doing this, do you know if there are other tools, or if a programmer could write codes to perform this 'query database - fill in ' process??
Thanks
-
- Senior Propellus Maximus
- Posts: 4293
- Joined: Thu Feb 02, 2006 9:29 am
- Location: The Electric City
Re: Querying a database for content
No, I do not of any ready to go tools for this that will automate that task and work seamlessly with Flare. If you generate browser based output then the code solution is most likely the most robust and easiest means. Yes, you would need the help of a fairly well-rounded web developer for this. It does not have to be PHP, there are other options. PHP is often the first option for writing 'glue code' like this.pviscogl wrote: Except 'esay way' of doing this, do you know if there are other tools, or if a programmer could write codes to perform this 'query database - fill in ' process??
Thanks
New Book: Creating user-friendly Online Help
Paperback http://www.amazon.com/dp/1449952038/ or https://www.createspace.com/3416509
eBook http://www.amazon.com/dp/B005XB9E3U
Paperback http://www.amazon.com/dp/1449952038/ or https://www.createspace.com/3416509
eBook http://www.amazon.com/dp/B005XB9E3U
Re: Querying a database for content
I know this is an old thread, but it's relevant to what I'm trying to do now.
If you changed the topic extension to .php, how did you do it? And if not, how did you "embed" the php code?
Thanks!
Kathryn
I've done this type of thing frequently on regular (non-Flare) websites. But in order to run PHP code on a page, I thought it had to have a php extension.RamonS wrote:You can do that with PHP. Embed PHP code in the page to connect to the database and query the tables, then prepare the results for output.
If you changed the topic extension to .php, how did you do it? And if not, how did you "embed" the php code?
Thanks!
Kathryn
Re: Querying a database for content
On the Advanced tab of the target there's an option "Use custom file extension for topics".