NineChime forum

Furry stuff, oekaki stuff, and other stuff.

You are not logged in.

#1 07-04-2006 16:22:50

ponyhome
Member

Clarification on install.php

On install.php, when I'm setting up the database, there are two lines where it says "database prefix."  After failing over and over and over again to get a connect, I'm having a sneaking suspicion.  Maybe I'm exceptionally slow, but does that actually mean "database TABLE prefix?"

If this is correct, may I suggest a slight re-write of the instructions, thus:
-----------------------
One MySQL database is required to install Wacintaki, even if you install multiple boards. If you do not know how to access your MySQL account, e-mail your sysadmin, or log into your control panel and look for a database tool such as phpMyAdmin. On most servers, “localhost” will work for the hostname, though web hosts with a dedicated MySQL server may require something such as “mysql.server.com”. Be aware that some database tools, such as CPanel or phpMyAdmin, may automatically add a prefix to your database name or username, so if you create a database called “oekaki”, the actual name of your database may end up being “accountname_oekaki”.  The OekakiPoteto table prefixes (default “op_”) are only significant if you wish to install more than one oekaki in your database.

-------------------------------------
Okay, tried it making the distinction between tables and databases, and it worked.

I'd also suggest changing "database prefix" to "table prefix" or "database table prefix."

Now to see if I can restore my 1.2.4 Wac DB into 1.3.2  Hopefully the structure hasn't changed.

Offline

#2 07-04-2006 20:07:52

Waccoon
Administrator

Re: Clarification on install.php

So noted.  It's been a while since I've reviewed those directions.  smile

Please note that the need to update the database depends on the version number on the config file.  If you have a 1.2.4 database backup, and you just did a clean install of 1.3.2, you cannot import the old database (the updater won't even detect the conflict).  You must install 1.2.4, import the database, and then perform the update to 1.3.2.

Offline

#3 07-05-2006 13:00:17

ponyhome
Member

Re: Clarification on install.php

Well, yeah, I probably should have done it like you said, but I'm not very good at following directions, so I didn't even use the updater (is THAT what it does!).  I went through and compared the fields in the tables one at a time, and modified the SQL backup file to provide blank fields where the new fields were, and to get rid of the redundant table defines.  Not something I'd recommend to casual users, so I can see why you'd use the word "cannot." :-)  It seems happy enough with the populated database, though.

Actually, compared to migrating my general purpose website database from postgres to mysql (and fixing all the php code that referred to it), importing the saved wacpoteto database was a breeeeeeeze.  I really don't like the way MySQL does time.  A whole lot.  In Postgres it was relatively simple to figure out the number of seconds between a saved timestamp and the current time.  I'm sure there must be a way to do it in MySQL (somewhat sure, at least), but I finally gave up and did it in PHP.

Offline

#4 07-06-2006 02:26:46

Waccoon
Administrator

Re: Clarification on install.php

Most of the database changes were just adding things to the memberlist tables, like avatars.  There was a change in 1.3 for the sorting of pictures, though.  Make sure that in the "oekakimisc" table, the "piccount" value is equal to the newest image in your pictures folder.  For example, if the newest pictures is "OP_127.png", make sure the piccount value is 127.  Otherwise, if the piccount were 32, some pictures will be overwritten.

To get a UNIX timestamp based on seconds, use this MySQL code:

"SELECT FROM {table} UNIX_TIMESTAMP(postdate)"

...or this:

"SELECT FROM {table} UNIX_TIMESTAMP(postdate) AS unixdate"

...which will return the value under the name "unixdate" instead of "postdate".

Offline

#5 07-06-2006 10:53:15

ponyhome
Member

Re: Clarification on install.php

Oh, getting the timestamp in seconds wasn't hard.  It was having MySQL do the math of subtracting off the current time, and just returning a differential time in seconds (which is much more efficient, given that it's hard-coded in the database).

In Postgres, I did it like this:

SELECT EXTRACT (epoch FROM ('now'-last_time)) AS time_passed

Which returns the number of seconds elapsed from the timestamp saved in the database.  (I believe that this would work in Oracle, too)

It was soooo simple in PSQL, but I beat my head against how to do that in MySQL, and eventually gave up and did what you said above -- pull the unixtime from the record and use PHP to find out how much time had passed.  Like I said, I was unimpressed with MySQL's time functions.

Thanks for the tip.  I'll check on the piccount value (I'm assuming that's the "miscvalue" field).  Should the dbversion be changed?  It's showing  1.3.0 in the "strings" field right now.

Last edited by ponyhome (07-06-2006 11:46:03)

Offline

#6 07-06-2006 16:40:35

ponyhome
Member

Re: Clarification on install.php

Bump, because the last message apparently didn't get completely logged when the server went down today.

Offline

#7 07-07-2006 15:23:28

Waccoon
Administrator

Re: Clarification on install.php

1.3.0 is correct.  That value is changed only when the database is updated, not for each new version of the board.

To correctly handle date and time deltas in MySQL, you need to use the ADD_DATE() and SUB_DATE() functions, along with INTERVAL, as follows:

{something} WHERE (DATE_ADD(lastlogin, INTERVAL 5 DAY) <= NOW())

What this does is get the timestamp for "lastlogin" and the MySQL amount of time for 5 days, and add them together.  It then compares this to being less than or equal to NOW().  This allows you to figure out who logged in more than 5 days ago.

Yes, it's a pain.  A lot of people don't like the way MySQL handles time.

Offline

Board footer

Yep, still running PunBB
© Copyright 2002–2008 PunBB