Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MySQL and Applescript



MySQL is VERY much accessible with Applescript. The key is that you send
queries through shell commands. For instance:

set theResult to do shell script "/usr/local/mysql/bin/mysql -u username
-ppassword -D 'database' -N -e \"SELECT column FROM table WHERE otherColumn
= 'someVariable'\""

You can then use theResult as a variable to do whatever you want with. Look
for "MySQL4Applescript" on Google. You can either use these handlers as is,
or look at them for various ways to run queries. I wrote an entire AS
application that stores its data in a MySQL database. It works great!

Good luck. Feel free to ask questions,

John

P.S. the -N forces the query NOT to return the column name(s). The -e is
needed in every shell command not sent through the terminal. You can look
at all the options at MySql.com or they are listed in a man page.

on 7/23/04 11:33 AM, Jan Erik Mostrvm at email@hidden wrote:

> What are my alternative if I want to access MySQL from an AppleScript?
>
> I searched the web and found something called "MySQL Bridge" but it wasn't
> available for download.
>
> jem
_______________________________________________
applescript-studio mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-studio
Do not post admin requests to the list. They will be ignored.




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.