Gossamer Forum
Home : Products : DBMan : Customization :

how to remove characters from $rec{'ID'} field..

Quote Reply
how to remove characters from $rec{'ID'} field..
I manually add blank records to my database to start with.. and use an ID like V001.. V002...

when I link my short list results to my long record I get a Blank Page.. ie. $long_url = "$db_script_url?$long_url&nh=$rec{'ID'}&mh=1";

If $rec{'ID'} displays V001 it does not work and if I take the V away it does work ie. 001

Anyway... i need to know how to strip this V out before it gets displayed.. Thanxs alot.. Justin

is this possible..??
Quote Reply
Re: [JustinS] how to remove characters from $rec{'ID'} field.. In reply to
If you want to be able to use your ID prefix here is what I use. In my .cfg file I define the variable for the prefix in my case "AU".

$count_prefix ='AU'; ### used as prefix for ItemID count number


Then I made the following change in my db.cgi file in sub get_defaults.

Comment out this line:

## $default{$db_key} = <ID> + 1; # Get next ID number - original

And instead use:

$default{$db_key} = "$count_prefix-$count"; # Get next ID number .. chg'd line ##

This will display your prefix and I'm hoping that is what you really want to do.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/