Gossamer Forum
Home : Products : Links 2.0 : Customization :

Bobsie or Alex

Quote Reply
Bobsie or Alex
I have to convert a database that has been setup with the basic fields. Using the following I can convert it and add additional fields to the end of the database.

# -------------------------------------------
$ENV{'REQUEST_METHOD'} and (print "Content-type: text/plain\n\n");
open (DB, "<links.db") or print "Unable to open links database 'links.db'. Reason: $!" and exit;
open (DBOUT, ">links2.db") or print "Unable to open output database. Make sure hits dir is chmod 777 temporairly. Reason: $!" and exit;
while (<DB> ) {
chomp;
s/NULL//g;
print DBOUT "$_&#0124; &#0124;&#0124; &#0124;&#0124; &#0124;\n";
}
close DB;
close DBOUT;
print "Added two new fields onto the end. Saved it as links2.db. Change permissions back to 755 on the hits directory.";
# ---------------------------------------------

Question: How can I convert the database and add 2 new fields to the middle and 2 new fields to the end, without altering the present information in the databse?



------------------
Joker
Concepts 2000 Online
www.concepts2000.com
tech@concepts2000.com

Quote Reply
Re: Bobsie or Alex In reply to
It is pretty easy, but you will have to tell me where EXACTLY you want the two feilds added.



------------------
Sincerely,

Netoo! Support
Netoo! Internet Services Of America.
http://www.netoo.phiberoptix.com
Quote Reply
Re: Bobsie or Alex In reply to
How about field # 5 and 6.



------------------
Joker
Concepts 2000 Online
www.concepts2000.com
tech@concepts2000.com

Quote Reply
Re: Bobsie or Alex In reply to
Have you looked a crisco's script to add new fields to a database? It is located at http://www.gossamer-threads.com/...um3/HTML/001090.html

I think it will meet your needs.
Quote Reply
Re: Bobsie or Alex In reply to
I would like to know how to convert a links datbase (links.db) and a dbman database (default.db) into one NEW database called all.db. This new database has to be renumbered.

Is there already a special updatescript for this problem? If anyone know's one, please let me know.
Quote Reply
Re: Bobsie or Alex In reply to
Ok Bobsie, tell me your secret, I searched for a long time trying to find this kind of mod, and I couldn't find it. Thanks, it is just what I needed.



------------------
Joker
Concepts 2000 Online
www.concepts2000.com
tech@concepts2000.com

Quote Reply
Re: Bobsie or Alex In reply to
ds,
It may be hard since you may have different feilds in each database. I know I can do it, but it may be a bit hard to explain. If you want me too, I can right out a page or two of instructions for you....

Jimz

------------------
Sincerely,

Netoo! Support
Netoo! Internet Services Of America.
http://www.netoo.phiberoptix.com
Quote Reply
Re: Bobsie or Alex In reply to
Joker,

Quote:
Ok Bobsie, tell me your secret, I searched for a long time trying to find this kind of mod, and I couldn't find it.

Easy. I bookmarked it! Smile