Getting Started with a Database
Trevor DeVore
lists at mangomultimedia.com
Tue Feb 14 13:50:23 EST 2006
Hi David,
>> It looks like you haven't created the recipes database in MySQL.
>> Did you import the recipes.sql file into your MySQL database?
>
> I am really not sure what I have to do. I downloaded
> libDatabase_2.zip. This expanded into a folder called "libDatabase
> 2.0" which contains the following files and folders:
>
> libDatabase.rev
> Change Log.txt
> docs folder
> bmm-code.css
> Getting Started.pdf
> libDatabase Handlers.html
>
> I then downloaded:
>
> recipes.rev
> recipes.sql
>
> and put them in the "libDatabase 2.0" folder. I then double-clicked
> the "recipes.rev" file and got the message:
>
> "libdberr: unable to connect to database (Unknown database
> 'recipes')".
>
> I am not sure how to import recipes.sql into the MySQL database and
> can't seem to find any information on how to do it anywhere.
A couple of things to address here.
Creating the database
The recipes.rev file assumes that you have already created the
recipes table in your MySQL database. That is what the recipes.sql
file is for. I did a search on google on the phrase "import sql into
mysql" and there were some useful results. Some people mentioned
some MySQL database editors you could download. Those will have the
ability to import a sql file through a menu option. In CocoaMySQL it
is File->Import->CocoaMySQL dump.
libDatabase 2.0
The recipes.rev stack will not work with libDatabase 2.x as there
were some changes to the API which made the two incompatible.
libDatabase 2.x is marked as beta mainly because I haven't had time
to put together example stacks, etc. If you use the recipes.rev
stack with libDatabase 1.x and understand the concepts then switching
to libDatabase 2.x in your project should be very easy.
> I have now looked that three database solutions and none of them
> seem to work and there seems to be very little "getting-started"
> information supplied with them.
libDatabase does work, it just doesn't have any good introduction to
databases documentation/examples with it. I believe the Getting
Started guide that comes with libDatabase 2.x contains enough
information for someone who has a solid understanding of both
Revolution and SQL databases. If you are new to databases then you
may have difficulties because there isn't an "Introduction to SQL
Databases and Revolution using libDatabase" article. I would love to
write one someday but I don't know when that will happen.
>> Also, I highly recommend using version 2 of the libDatabase
>> library (available from the same page as version 1). Version 2
>> does not have an example stack but there is a getting started doc
>> which describes the differences between version 1 and 2 along with
>> code explaining the main functionality.
>
> All I want is a simple database in order to build a prototype
> application to take to a prospective client and try to convince
> them to buy into the project.
>
> I need to store and retrieve via the following fields:
>
> Name | Type | Size | ImageFilePathName
>
> I have a CD with around 200,000 objects on it that I want to enter
> into the database.
>
> I don't want to lay out a lot of money at this stage nor do I want
> to have a massive learning curve to get it working. If I get the go
> ahead on the project then the database will be extended, a run time
> license purchased and I will of course be prepared to invest a lot
> of time learning about it. But right now, time is of the essence
> and I just want to get something up and running ASAP!
I don't know that you can get around a learning curve given the
current state of things, even to just have the 4 fields that you
desire. Given that time is of the essence and this seems to be a
prototype I would bypass SQL altogether. Just use a card database to
store the information (do you need all 200,000 records for the
prototype?) and show proof of concept. If you get the go ahead then
you can learn about SQL databases and implement one in your project.
SQL is an incredibly powerful way to manage your data so it is
definitely worth learning about IMO.
--
Trevor DeVore
Blue Mango Multimedia
trevor at mangomultimedia.com
More information about the use-livecode
mailing list