Re: openOffice Php MySQL



On 2008-02-21, db <blacklist-me@xxxxxxxxxx> wrote:
Vahis wrote:

On 2008-02-21, David Bolt <blacklist-me@xxxxxxxxxx> wrote:

The directors names are now links, as are the release years, and you
get a list of movies directed by a specific director, or released
during a particular year. I've added a limit so that you can restrict
the number of movies initially displayed. When I get some more free
time, I'll add in the necessary code so you can skip forwards and
backwards a page at a time.

<snip>

I'm trying to set up a movie database with the titles, release years,
starring actors, possible Academy awards etc.

Oh, one extra column in the table. No problem, it's easily added.

A bit like IMDB but only a few movies. I'm not saying that these
movies would exist for example on my server or anything, but let's
just assume that this database would today consist of maybe 300
titles.

Easy enough. The first couple of versions didn't support paging. The
latest one lets you choose between 25, 50, 100, 200 or all entries.

You can see the demo here:

<URL:http://www.davjam.org/~davjam/vahis_demo/index.php>

Awesome!
That's pretty much I've been having in mind :)

I've split the code up a bit as it makes it easier to re-use parts in
the other pages, so there's a few more source files here:

<URL:http://www.davjam.org/~davjam/vahis_demo/index.txt>
<URL:http://www.davjam.org/~davjam/vahis_demo/director.txt>
<URL:http://www.davjam.org/~davjam/vahis_demo/get_parameters.txt>
<URL:http://www.davjam.org/~davjam/vahis_demo/nav_table.txt>
<URL:http://www.davjam.org/~davjam/vahis_demo/pick_display_count.txt>
<URL:http://www.davjam.org/~davjam/vahis_demo/releases.txt>
<URL:http://www.davjam.org/~davjam/vahis_demo/setup_database.txt>
<URL:http://www.davjam.org/~davjam/vahis_demo/write_table.txt>

These will all need to be renamed as .php files to work, and you'll need
to fill in the required details in setup_database.php for it to work.

And, with the new column, the command to create the table is here:

<URL:http://www.davjam.org/~davjam/vahis_demo/create_table.sql>

However, first you'll need to create a database so, while you have the
MySQL console open, use the command:

create database <database_name>;

In the meantime I was able to create a couple of databases.
No tables or anything yet.


Just to make sure, you do need the ';' at the end of the command or
MySQL doesn't know you've finished it.

I realised that at a stage. It was a bitch. (syntax errors are)


Once you've created the database, you'll need to start using it. You do
that by using the command:

use <database_name>;

Then you can copy and paste in the contents of create_table.sql .

After that, it's just a case of adding the data from the spread*** :)

I have MySQL running now.

So far I haven't been able to figure out how to set up anything in
there. I just don't bloody know how to start with anything.

Unless you're going to be manipulating the database directly, you can
virtually ignore using the MySQL console, and use PHP to do the
necessary queries.

I also became aware of the GUIs MySQL Administrator and Query Browser.
I installed them and had a quick look.
They looked like something I might get along with.
I thought maybe I would use those to maintain the database while the
results would be shown in Php pages.

Now who needs to be the database root? Another user or the real thing?
Who needs to be the user to edit the information and who is showing it?

I'm this far anyway:

mysql> SELECT NOW();
+---------------------+
| NOW() |
+---------------------+
| 2008-02-21 19:59:24 |
+---------------------+
1 row in set (0.02 sec)

Yippee!

:-)

After this I decided to get some sleep and now the cab is here again :(
I'll be back in another ten to twelve hours...

Vahis
Remodeling my site to train new things:
http://waxborg.servepics.com
--
"The only thing more expensive than training is the lack of it"
Henry Ford
.