Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > databases and osx

databases and osx
Thread Tools
qnc
Mac Enthusiast
Join Date: May 2000
Location: London U.K.
Status: Offline
Reply With Quote
Jan 27, 2005, 06:12 AM
 
i know that you can run mysql on osx however can you get it to generate documents ideally word documents I know that it can write to php which can write to a web page but what about writing to local files?

just curious if it was possible?
qnctv.com
Take a look...
     
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Jan 27, 2005, 06:35 AM
 
Not sure about generating word docs - but I know that PHP allows PDF generation.
     
qnc  (op)
Mac Enthusiast
Join Date: May 2000
Location: London U.K.
Status: Offline
Reply With Quote
Jan 27, 2005, 06:47 AM
 
even better!!

Will read my php books on how it is done any advice before I wade through chapters and chapters?

Also I am used to hard coding php into a .php html documnet I never tried it as a stand alone what would I use terminal call up text edit files?
qnctv.com
Take a look...
     
Professional Poster
Join Date: Oct 2001
Location: London
Status: Offline
Reply With Quote
Jan 27, 2005, 07:30 AM
 
http://www.google.com/search?q=PHP+P...8&oe=UTF-8
http://www.ros.co.nz/pdf/
http://www.fpdf.org/

As for local generation - You can use the local apache web server.
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Jan 27, 2005, 07:31 AM
 
If you're going to use local files, then there are probably better options than PHP; it works, but that's not what it was designed for.

What I'd actually do is use Perl (probably Python in my case, but Perl is more widely-known; both come with OSX) to generate LaTeX code, then use LaTeX to generate the PDF. LaTeX doesn't come with OSX, but it's available for free, and there's even a version that handles all the nifty stuff OSX can do with fonts.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Jan 27, 2005, 07:32 AM
 
If you insist on PHP code, though, then I still recommend using it to generate LaTeX and then going from there to PDF; the coding style will be more familiar to you if you're in the habit of embedding PHP into HTML.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status: Offline
Reply With Quote
Jan 27, 2005, 08:57 AM
 
qnc: I am going to hazard a guess that FileMaker would probably be a better fit for what you are looking for. It has the ability to be the datasource for Word mail merges, and can be used to create PDF's with a little scripting (very little... just script the print phase). But this all depends highly on what you are trying to accomplish, and you are simply too skimpy on the details for anyone to provide good advice.
     
Forum Regular
Join Date: Jan 2001
Status: Offline
Reply With Quote
Jan 27, 2005, 11:18 AM
 
Its not that easy as a newbie to get nice looking documets from LaTeX, but if you are interested look at this book: The Not So Short Introduction to LaTeX, as a guide, if you got any LaTeX question, I be happy to help you.

mirror: http://people.ee.ethz.ch/~oetiker/lshort/lshort.pdf
     
Senior User
Join Date: Jan 2000
Location: Burlington, VT, USA
Status: Offline
Reply With Quote
Jan 27, 2005, 11:23 AM
 
Originally posted by Millennium:
If you're going to use local files, then there are probably better options than PHP; it works, but that's not what it was designed for.

What I'd actually do is use Perl (probably Python in my case, but Perl is more widely-known; both come with OSX) to generate LaTeX code, then use LaTeX to generate the PDF. LaTeX doesn't come with OSX, but it's available for free, and there's even a version that handles all the nifty stuff OSX can do with fonts.
Unless I'm imagining things, you can pretty much do anything with php that you can with perl. you can execute the php script from the command line

php whatever.php

Jon
     
qnc  (op)
Mac Enthusiast
Join Date: May 2000
Location: London U.K.
Status: Offline
Reply With Quote
Jan 27, 2005, 11:23 AM
 
We have order forms for the things we need at work supplies I now have 150 page word document each page with a different item when a company changes name or when I have to find the lowest price on a product it is a nightmare also it is not automated in terms of my work load so I can't generate standard orders at various intervals.

So I was thinking....

database that can make my order forms

I can query for lowest price etc...

i can change comany details..

I can have programmed these are the feilds. Looking at it if it was as a web site which I might just do anyway intranet etc.. i would not be so daunghted.



DATE
COMPANY NAME
ADDRESS
FAX NO
CATEGORY
(please tick) Computing (K) / Furniture (F) / Lab supplies & equipment (L) /
Photographic (A) / Travel (T) /Stationary (S)/ Other
PRODUCT DESCRIPTION
CATALOGUE NO
PACK SIZE
UNIT PRICE
QUANTITY
REQUESTED BY
AUTHORISED BY
ACCOUNT CODE
ANALYSIS CODE
FOR OFFICE USE ORDER NO


I hope that is clearer?
qnctv.com
Take a look...
     
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status: Offline
Reply With Quote
Jan 27, 2005, 12:55 PM
 
Ok... I am going to second my recomendation for FileMaker Pro. You will be able to setup the database within a couple of hours of opening the box. I am being generous with that time (I think it will take less time) as I am counting in all the time it will take to tweak your reports so that they look "just right".

If you want to have a pdf of a page, just print it and "save to pdf". With some creativity this can be automated.
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Jan 27, 2005, 12:56 PM
 
Originally posted by leperkuhn:
Unless I'm imagining things, you can pretty much do anything with php that you can with perl. you can execute the php script from the command line

php whatever.php
True, but with two issues. One, this is not what PHP was designed for, and this becomes clear when you look at the options out there. For example, the only GUI library out there that talks to PHP is GTK, and although that can run in an X11 session it means learning a completely alien GUI system (relative to OSX).

The other problem is that it doesn't mesh well with the coding style that the author of this thread appears to prefer: mixing PHP and HTML freely. There is no GUI I'm aware of that lets you code in such a manner.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status: Offline
Reply With Quote
Jan 27, 2005, 09:00 PM
 
FileMaker Pro would definitely be the easiest tool for your job.

It is expensive though. If you can afford it, then do it.

If you can't you'll have the difficult job of learning the freeware alternatives such as MySQL and PHP, etc.

Now to be a bit pedantic...

Your original question was along the lines of: Can MySQL generate documents such as Word documents?

The short answer to this is no, not really. MySQL is a database and only a database. All it does is store manipulate and retreive data, as directed by SQL commands.

To do anything useful with MySQL, you need an SQL-compliant application or program suite (such as a set of PHP scripts and a web server), to display the data, or print the data, or do anything even vaguely user-friendly with the data.
     
Senior User
Join Date: Jan 2000
Location: Burlington, VT, USA
Status: Offline
Reply With Quote
Jan 28, 2005, 12:56 AM
 
Originally posted by Millennium:
True, but with two issues. One, this is not what PHP was designed for, and this becomes clear when you look at the options out there. For example, the only GUI library out there that talks to PHP is GTK, and although that can run in an X11 session it means learning a completely alien GUI system (relative to OSX).

The other problem is that it doesn't mesh well with the coding style that the author of this thread appears to prefer: mixing PHP and HTML freely. There is no GUI I'm aware of that lets you code in such a manner.
I won't argue w/ this, as I haven't written a GUI for php without HTML.

This also brings me back to the off-topic discussion that apple needs DB libraries in Objective-C. If it is already in Tiger or Panther, I don't know about it, and please correct me.
     
Senior User
Join Date: Jan 2000
Location: Burlington, VT, USA
Status: Offline
Reply With Quote
Jan 28, 2005, 12:58 AM
 
I'm not sure if this helps, but if you can do something with XML you could use this:

mysqldump --xml databasename > filename.xml

http://insight.zdnet.co.uk/software/...2112200,00.htm
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Jan 28, 2005, 07:18 AM
 
Originally posted by leperkuhn:
I won't argue w/ this, as I haven't written a GUI for php without HTML.

This also brings me back to the off-topic discussion that apple needs DB libraries in Objective-C. If it is already in Tiger or Panther, I don't know about it, and please correct me.
"DB libraries"? Do you mean ODBC access or something? I know that there are ODBC libraries for OSX, but that's all I'm aware of at the moment. There are other libraries available for download.

Tiger's CoreData framework, however, is based on SQLite.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
Senior User
Join Date: Jan 2001
Location: Mahwah, NJ USA
Status: Offline
Reply With Quote
Jan 28, 2005, 09:11 AM
 
Originally posted by Millennium:
"DB libraries"? Do you mean ODBC access or something? I know that there are ODBC libraries for OSX, but that's all I'm aware of at the moment. There are other libraries available for download.

Tiger's CoreData framework, however, is based on SQLite.
Hmmm... I was thinking of the same thing. Correct me if I am wrong but even Filemaker requires that MS-Office be installed before it "creates" MS-Word files, no? If yes, then presumably it does this using some sort of ODBC (just guessing).

I do know that OpenOffice.org can connect to a MySQL database using MyODBC. One can use the OOo data source "wizard" to create tables and entities for the database and forms for data entry and reports etc...

I looked it up at www.mysql.com and one can also use MS-Word and MyODBC in a similar manner. In other words, unless the OP wants to "web enable" his database then he can forget about all this PHP and Perl and whatnot. All he needs to do is just use it with his current MS-OfficeX + MyODBC + MySQL.
-DU-...etc...
     
qnc  (op)
Mac Enthusiast
Join Date: May 2000
Location: London U.K.
Status: Offline
Reply With Quote
Jan 28, 2005, 10:47 AM
 

All he needs to do is just use it with his current MS-OfficeX + MyODBC + MySQL.
tell me more about MyODBC what is the learning curve like

In the mean time will try this thirty day trial of filemaker

on another point It is interesting how we view things I have got so web orientated that I approach the issue from a web point of view however I am seeing more and more that there are so many paralles

e.g.
info holder --> <-- info query system --> display
database --> <-- php--> HTML
database --> <--MyODBC-->MS-OfficeX
><---------filemaker pro------------><

I assume file maker pro is cross platform as we have both pc and mac here and it may be an option for our department instead of just for orders.
qnctv.com
Take a look...
     
Senior User
Join Date: Jan 2000
Location: Burlington, VT, USA
Status: Offline
Reply With Quote
Jan 28, 2005, 10:56 AM
 
Originally posted by Millennium:
"DB libraries"? Do you mean ODBC access or something? I know that there are ODBC libraries for OSX, but that's all I'm aware of at the moment. There are other libraries available for download.

Tiger's CoreData framework, however, is based on SQLite.
Yes, I mean ODBC. I know it's available from Java, but I don't think it's there for Objective-c.
     
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status: Offline
Reply With Quote
Jan 28, 2005, 12:20 PM
 
Originally posted by leperkuhn:
Yes, I mean ODBC. I know it's available from Java, but I don't think it's there for Objective-c.
Java database access is through JDBC, not ODBC. There are bridges, but usually it is:

Java -> JDBC
the C family (C, C++, Obj-C, Obj-C++, VisualC, C#, etc..) -> ODBC

The real problem with ODBC on MacOS X is that a lot of database vendors do not have ODBC drivers out for it. Without that you have to go to multi-tier systems, and that is well above the level of this conversation.

Keep it simple, go with FileMaker Pro.
     
Senior User
Join Date: Jan 2001
Location: Mahwah, NJ USA
Status: Offline
Reply With Quote
Jan 29, 2005, 05:51 PM
 
Originally posted by qnc:
tell me more about MyODBC what is the learning curve like
There basically isn't any learning curve... not if you already have MySQL installed (easy), MyODBC installed (also easy), Office v. X installed (easy) and a couple of other things I will get to shortly. MyODBC is merely "glue", a standard API, that most software that could ever interact with database understands.


In the mean time will try this thirty day trial of filemaker
Perhaps I should try it again also. Last time I looked Filemaker Pro was version 5 (or perhaps the previous version) about 5 years ago. Back then I found it to be very slow, unwieldy, and the learning curve was very steep for me. At the time I wanted some extra features for an existing inventory database (such as a web interface to the database) that would have cost me a lot of extra money and time to implement. I would have also have to upgrade to a newer version.

I really knew nothing about databases at the time except for a smattering of MS-Access. So I looked around at alternatives. I started playing with MySQL and found I could export the existing inventory to a flat CSV text file which I could then import into MySQL. It was not quite that simple due to a few artifacts left over from Filemaker. But a few Perl scripts cleaned those up nicely. Once that was done the only thing I needed to do was concoct a web based interface to the database. This was also quite easy... I just searched the web for a free inventory database interface written in PHP.... found several, tried a few, settled on one. Made a few tweaks to customize it for our particular needs and have been using it since. The database and the interface to that database that we ended up with is MUCH faster and more useful for our needs than the one we inherited in Filemaker. It cost me a bit of time but $0. I also learned a lot about how the database works and how to modify it for our needs. My database(s) are also in a non-proprietary format and I don't have to keep paying for upgrades and add-ons as I add new features. As they say it is win-win.


on another point It is interesting how we view things I have got so web orientated that I approach the issue from a web point of view however I am seeing more and more that there are so many paralles

e.g.
info holder --> <-- info query system --> display
database --> <-- php--> HTML
database --> <--MyODBC-->MS-OfficeX
><---------filemaker pro------------><

I assume file maker pro is cross platform as we have both pc and mac here and it may be an option for our department instead of just for orders.
Well it is kinda like that. The nice thing about going with a web based interface to your database is that it is truly "cross platform". As long as any given platform has a useable web browser and you write the app without any unique extensions then it will work wherever and whenever you need it. On any platform/OS from any location... no need to have to buy licenses in order to just use your database... to access your data in your database. There is even a buzz acronym for it, LAMP (Linux+Apache+MySQL+PHP/Perl) to which, I suppose, you could add MAMP(?) (Mac OS X+Apache+MySQL+PHP/Perl). Hmmm... since the AMP parts run on just about everything one could just say *AMP

In any case....

I grabbed the latest "recommended" MySQL from:
http://dev.mysql.com/get/Downloads/M...m/pick#mirrors
and the latest recommended MyODBC from:
http://dev.mysql.com/get/Downloads/M....dmg/from/pick
both of which come with nice standard installers.

I installed MySQL first. The mysql-standard-4.1.9-apple-darwin7.7.0-powerpc.pkg which is the standard MySQL and the MySQLStartupItem.pkg and also the MySQL.prefPane. The prefPane gives a nice GUI control for MySQL in System Preferences.
I started the database.
I then installed MyODBC. The MyODBC-3.51.10-apple-darwin7.5.0-powerpc.pkg. Which aslo has a nice standard installer and a setup dialog. The "Test" worked fine.

There is also an ODBC Administrator app in /Applications/Utilities/ that you need to configure. Open the app and you should see something like:
myodbc MySQL 3.51 Driver
in the User DSN tab.
Click on the Drivers tab and then the Configure button. Change "Define as:" from User to System. Then click OK and then Apply.

The ODBC Administrator app comes with Mac OS X.

I thought that was all there was to it but my version of Office v. X does not include the "Connector" utility. Perhaps the latest version is less braindead. I went to: http://www.microsoft.com/mac/downloads.aspx#OfficeX and grabbed the
http://download.microsoft.com/downlo...16UpdateEN.bin
and
http://download.microsoft.com/downlo...tQuery.sit.bin
Which allows Excel in Office v. X to connect to the MySQL database. For some reason I could not get Word to connect. All Word seems to want to do is use files.

Anyhow... I don't use Office (or even OpenOffice.org) to connect to databases and I don't know anyone who does use it however indirectly... so I don't have much experience with this sort of use of a database. With that said... it was pretty easy to setup. Should be even easier for you since I have done all the digging around already which really only took me about 15 minutes. It took longer to write this reply!
-DU-...etc...
     
qnc  (op)
Mac Enthusiast
Join Date: May 2000
Location: London U.K.
Status: Offline
Reply With Quote
Jan 30, 2005, 03:28 PM
 
cool utidjian will try it monday and let you know how I get on
qnctv.com
Take a look...
     
Dedicated MacNNer
Join Date: Sep 2003
Location: Pittsburgh, Pennsylvania
Status: Offline
Reply With Quote
Jan 30, 2005, 04:28 PM
 
Originally posted by leperkuhn:
Yes, I mean ODBC. I know it's available from Java, but I don't think it's there for Objective-c.
If there isn't an ODBC driver for Objective-C you could always write a wrapper in a language it supports. I know there is a C++ library for mysql, which is the DB in question. You could always write a simple driver that wraps the calls, then call that from Obj-C. You might give up a little speed doing that, but if you're hell-bent on Obj-C it's possible. Personally I would use C++ w/ the mysql library.
Apple iBook, B&W, Quadra 660, PowerMac 6100
Sun Netra T1, Ultra 1, Javastation
http://natetobik.mine.nu:81
     
Professional Poster
Join Date: Nov 2000
Location: Tasmania, Australia
Status: Offline
Reply With Quote
Jan 30, 2005, 05:10 PM
 
Originally posted by Partisan01:
If there isn't an ODBC driver for Objective-C you could always write a wrapper in a language it supports. I know there is a C++ library for mysql, which is the DB in question. You could always write a simple driver that wraps the calls, then call that from Obj-C. You might give up a little speed doing that, but if you're hell-bent on Obj-C it's possible. Personally I would use C++ w/ the mysql library.
There are already several such wrappers available for Objective-C. I even wrote one myself once, just to see how it could work. I then ditched it and wrote a wrapper for SQLite instead, because it's much faster, and more suited to my needs (ie, embedded RDBMS, rather than client/server RDBMS).

Then I found that Apple was doing the same thing with Tiger (but much better, and with modelling included, and some really advanced features), so I ditched that one too. Man it was fast though.
     
Senior User
Join Date: Jan 2000
Location: Burlington, VT, USA
Status: Offline
Reply With Quote
Jan 30, 2005, 10:32 PM
 
Originally posted by Partisan01:
If there isn't an ODBC driver for Objective-C you could always write a wrapper in a language it supports. I know there is a C++ library for mysql, which is the DB in question. You could always write a simple driver that wraps the calls, then call that from Obj-C. You might give up a little speed doing that, but if you're hell-bent on Obj-C it's possible. Personally I would use C++ w/ the mysql library.
I guess after using VB I expect this to be built into the OS and easy to use. This is the one of the only things that M$ has done right. If any of you have used it, you know what I mean.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 07:03 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2