Gossamer Forum
Home : Products : DBMan : Customization :

Oops!Add syncronization problem

Quote Reply
Oops!Add syncronization problem
hello Karen,Mark or anyone,
test on "Add record" by 2 users at the same time gave the same Id #.i let the other user fill in the page and Oops
when on "Display record" the record appeared twice with the same content but with 2 different record#'s
weird!isn't? i know you'll come up with some nice little fix
hope to hear from u soon
cheerOS
macagy


Quote Reply
Re: Oops!Add syncronization problem In reply to
Hi macagy, the first place to check for problems would be in the following area of your default.cfg file:

Code:
# The column name for the database key. Can be any column, but it must be unique!
# You can't have two records with the same key value!
$db_key = 'ID';
# Track the key? Should DBMan keep a counter of the next key to use? This isn't
# neccessary if you can guarantee that your entry in the key field will be unique
# (i.e. a userid).
$db_key_track = 1;
# Database delimeter.
$db_delim = '|';
# Use file locking (1 = Yes, 0 = No). Should be used, but won't work on Win95.
$db_use_flock = 1;
Check to make sure your settings in the config file are accurate.


Quote Reply
Re: Oops!Add syncronization problem In reply to
Hi Karen, Mark,
i'm sure you're having goodTime!I don't see you Online'Enjoy your weekend!when you're back how about you try to direct me in my customization of this DB;
i think i got it when you said karen if you DB_Key is unique; then i had it wrong because it shouln't have been 'ID'but rather 'UserID' and in that case the DB_KEY_TRACK='0' Correct? let me see if you understand what is needed:
-1-Posting # ( numeric field generated by the system in sequence EX:1,2,3,....)
-2-Category (Dropdown bouton of choices) mandatory field
-3-Title -mandatory field
-4-Description textarea -required field-(Html tags can be used-max length=2,000 characters)
-5-Initial Budget(Price) $value for this numerical field with a choice of range EX: $20-$40---mandatory field
-6-File upload (optional field-where text file/html file or photo can be attached;upload of a photo comes with a fee so here starts the shopping cart section)Here too i link :<View tips for uploading files>
-7-URL optional field
-8-Email Optional field
-9- UserId i suppose this my DB unique key and must be mandatory( does it make sense?)
Now when all is said and done i need to see showing up Valid and Popular only on Admin Screen.On the user side it doesn't make sense to display them;(does it?)
Karen going back to your original post i would have to use pipes if i want to change and insert some of those new fieldName-
I think i have my plate full if i can manage to customize those easy task for your brillant and expertise in Perl,but me it looks like reaching one side of the Himalya
CheerOS
macagy


Quote Reply
Re: Oops!Add syncronization problem In reply to
Hi macagy, for what you've listed, I would say this field should be your db key:
Posting # ( numeric field generated by the system in sequence EX:1,2,3

You want the script to automatically keep track of the sequence number and increase by 1 each time a record is added.

UserId field would then be your $auth_user_field = 9; The auth_user_field is where the db will check to make sure the person making the request (add/modify, etc) is authorized to do the action they want to do.

Yes, you are correct - if you add additional fields in the .cfg file, you will need to add |'s in the proper place within your actual db.

You're getting the hang of it - Good luck!


Quote Reply
Re: Oops!Add syncronization problem In reply to
Hi Karen,
i need PLEASE your GO AHEAD for the following;
|'Post#' => [0, 'numer', 5, 8, 1, '', '' ],
|'Category' => [1, 'alpha', 0, 255, 1, '', '' ],
|'Title' => [2, 'alpha', 40, 255, 1, '', '' ],
|'Description' => [3, 'alpha', '40x3', 500, 0, '', '' ],
|'Initial budget(Price)' => [4, 'numer', 8, 8, 1, '$', '' ],
|'File_Upload' => [5, 'alpha', 40, 255, 1, '', '' ],
|'URL' => [6, 'alpha', 40, 255, 1, 'http://', '^http://' ],
|'Email' => [7, 'alpha', 20, 255, 1, '', '.+\@.+\..+' ],
|'UserID' => [8, 'alpha', 0, 15, 0, '', '' ]
===================================================
$db_key = 'Posting #';
$db_key_track = 0;
$db_use_flock = 1;
$db_auto_generate = 1;
$auth_user_field = 9;
==========================================
the subhtml_recor_form & sub html_record don't have to be printed in sequence;i believe the main strust comes from the cfg file!
i see a difficulty in the file uploading section but i wait to see if you agree with me so far;
CheerOS
macagy



Quote Reply
Re: Oops!Add syncronization problem In reply to
Hi macagy,

'Post#' => [0, 'numer', 5, 8, 1, '', '' ],
You really would be better off not using the # sign in there - could save a lot of grief later. The # sign is a special character in perl.
'Post Number' => [0, 'numer', 5, 8, 1, '', '' ],
'Post_Number' => [0, 'numer', 5, 8, 1, '', '' ],
Either of the above would be better, the second method with the underscore would probably be the better of the two.

$db_key = 'Posting #';
Keep in mind, you need this to be exactly the same as the actual field name. In your example you had 'Post#' => (note the spelling & no space before the # sign)
If you use one of the examples I offered, this would become $db_key = 'Post_Number';

$auth_user_field = 9;
You do not have a field number 9, the last of your fields is number 8. Keep in mind, you are not 'counting' down the number of fields, you are identifying the fields position within the database and the database starts at ground zero (field position '0')

$db_key_track = 1;
You want the db to keep track of what the next record number should be - this is how the sequential numbering gets in there. This variable should be 1

Good luck!




Quote Reply
Re: Oops!Add syncronization problem In reply to
Hi Karen,
i'm glad i see u online;woufff talk about a mess;now i know why you told me good luck!you knew what was coming!
-1-debugging set @ 1 do not show up( it cost me 3 chocolats in the row)
-2-i tried all possible ways with the delimiter | for cfg
=================%db_def = (
|'Post_Number' => [0, 'numer', 5, 8, 1, '', ''],
|'Category' => [1, 'alpha', 0, 255, 1, '', ''],
|'Title' => [2, 'alpha', 40, 255, 1, '', ''],
|'Description' => [3, 'alpha', '40x3', 500, 0, '', ''],
|'Price' => [4, 'numer', 8, 8, 1, '', '' ],
|'File_Upload' => [5, 'alpha', 40, 255, 1, '', '' ],
|'URL' => [6, 'alpha', 40, 255, 1, 'http://', '^http://'],
|'Date' => [7, 'date', 12, 15, 1, &get_date, ''],
|'Userid' => [8, 'alpha', 10, 15, 0, '', ''],
|'Email' => [9, 'alpha', 40, 60, 0, '', '.+\@.+\..+'],
|'Validated' => [10, 'alpha', -1, 3, 1, 'Yes', 'Yes|No'],
|'Popular' => [11,'alpha, -1, 3, 0, '', '']

);
===========================
my db_key='Post_Number'
my DB_Track=1
my debug=1
my auth_user_fiels=8
==================
why do i have 'DBMan encountered an internal error. Please enable debugging to view.'
i'm going for a walk and try to get some fresh air!when back i'll go thru again every single step after the changes!
i have saved a copy just before but still! who cares i'll back in 2'
cheerOS
macagy


Quote Reply
Re: Oops!Add syncronization problem In reply to
I am sure sorry! I saw the | in your earlier post but didn't think a lot of it. Many email settings cause a | to be added on forwaded text - thought maybe you were doing direct email with someone and had copied |'s from an email or something.

You do not add the |'s to the field definitions. They should simply be:

'Post_Number' => ...
'Category' => ...

Try removing those preceding pipes then uploading the file again.

Quote Reply
Re: Oops!Add syncronization problem In reply to
Hi Karen,
Good morning.i tried deb 1 and 0 nothing comes out;i also removed the pipes to no avail!
i went thru the sub's to see if any discrepency and again i can't figure out what's the matter with my customization!
let me see when i did change the cfg with new set of fieldnames all i had to do was to updates the sub html_record_form and sub html_record correct?
then i said maybe the ID must be in the fieldnames so i replaced Post_Number with ID;now my DB_Key = 'ID'
so far it seems i did whatever was to be done!and i uploaded all of this ASCII
Karen any clue where/what i should look for?
cheerOS
macagy

Quote Reply
Re: Oops!Add syncronization problem In reply to
Hi macagy, could you save each of your files as text files and upload them to an area of your server where the files can be viewed?
Save the files as:
db.cgi.txt
html.pl.txt
default.cfg.txt

I'll need to be able to see the files before being able to help determine what is happening there. Post the url where the files can be viewed. Something like yourdomain.com/path/to/files


Quote Reply
Re: Oops!Add syncronization problem In reply to
hi karen,
i found a thread from jpdeni re:debug not showing;it had to be removed to db.cgi,that's how i got my info;you won't believe it it was a stupid error of mine i missed a comma!that was it; now i am looking all around my past posts and it looks like some are missing.
i don't know if you remember last week i had a similar bug where my "add a record" shows o.k. but on View "List_all" it gets screwed up.would you recall how to fix it?
cheerOS
macagy

Quote Reply
Re: Oops!Add syncronization problem In reply to
Hi macagy, it's good to hear that you found a cause of some of the problems :) I don't remember specifically what last week's problems were <grin> but, you can go and review those threads.

Tricky thing on the forum display - it works like dbman itself - the 1st page of topics you are viewing is actual Page 0. The entries immediately prior to recent topics begin at Page 1. Your posts are there, I just checked.


Quote Reply
Re: Oops!Add syncronization problem In reply to
Hi Karen,
you're right i found my previous threads,but somehow i can't see any reply re:View mode. i wished you could've giving me a hint where to check or what the usual spot people overlook to do such an error!Adding a record is fine but when on List all the ID # gets in different line and the rest of the record is also moved up or down!
i tried different scenarios with DB_key # and my db definitions; nothing doing!i even got the Validation and popular hidden from the user!almost there but!!!!!!!!!!
i'm going to look for more threads in the mean time
cheerOS
macagy

Quote Reply
Re: Oops!Add syncronization problem In reply to
Hi macagy, the previous thread (Error Record, I think) did have the fix in it. The fix had specifically identified Email field however, it is the same fix for the problem you have. If you are still "starting out" and don't have any "actual records" in it yet, you can download default.db, empty the contents then, upload the file to the server again and Add a new record. OR >>>

You can correct the | problem in the db. Somehow, you have added fields in the config file but you have not added the pipes to properly sort the fields.

For example, if you have an entry such as:
Email => [3, 'alpha', 10, 255, 1, '', '']
this is indicating the Email field is the third position in your database:

field1|field2|Email|field4....etc

If you did not modify the database file to include the additional new field, your db contents are out of position and will result in the wrong input attempting to populate a db field - hence, the too long error.

Fix Your options would be
1) If this is a fairly new db with not manyrecords, simply modify the database by placing a pipe | in the proper position within the database (between the URL and Type fields).




Quote Reply
Re: Oops!Add syncronization problem In reply to
Karen,
well you getting close to be elevated Knight of night!!!!
you were right! tomorrow another day
ANOTHER FINE DAY!!!Thank you very much
i hope you're not planning any vacation for the near future
Stick around!! you're doing a great job
cheerOS
macagy

Quote Reply
Re: Oops!Add syncronization problem In reply to
Thanks macagy, really pleased you have gotten your db working. Now's definitely the time to test it out, make sure you have the fields you'll be needing (at least for the short long-term :) and check out the features.

You'll really appreciate what this script can do once you begin fully customizing things and getting the pages/features looking the way you want.

"vacation"??? Is that Greek or Russian :)
Good luck!

Quote Reply
Re: Oops!Add syncronization problem In reply to
Hi Karen
using db as a classifields needs a List_all viewed differently. i managed to change a bkcolor;you know i found the link for login and create a new account from a web mainpage!that'll do it for a starter
the main hassle is how to show the List_all looking like the forum has at the viewing all and then click on 1 of the fields such as username for displaying the complete record from the original demo.
does it sound complicated? i went thru threads under Viewing;list all;display;layout and still couldn't find a question similar to my likings!here is a diagram as ex;
id: Title: Category: Description: Date:
-----------------------------------------------------------
5 | consulting,| service,| Restructure a dep't | 09/13/00

== ========= ====== ================== 09/13/00
and so on;pretty basic!
i combine my studies with some few hours a week to make a buck! i'm getting my pay cheque friday;you won't be able to buy the EIFFEL TOWER with this gift certificate however you can pick it up @ Amazon or Gap or else, send the choice thru "send private"
talk to you later
cheerOS
macagy

Quote Reply
Re: Oops!Add syncronization problem In reply to
Hi macagy,

Okay, I see what you are doing - visit Resources >> DBMan >> Modifications and look for the Short/Long mods. This mod will allow you to have initial search results list in one format while the full record can be displayed in a different format. The mod is not difficult (at all) although you will not be able to just cut 'n paste.

You'll need to pay attention to the lines you change and stay alert for making changes to changes to mods you've already added.

Good luck!




Quote Reply
Re: Oops!Add syncronization problem In reply to
macagy, I forgot to mention - the short/long display mod has two versions. Be sure to download the correct version. Differences? One version is to be used with the user-friendly_html.pl and the other is to be used with the regular html.pl file. Descriptions in the Resource area are clear on which is which.

Karen

Quote Reply
Re: Oops!Add syncronization problem In reply to
Hi Karen
a quick one;the fact that the 'list all' shows only the title instead of the rest four field that i chose has to do with the tags in sub html_record? as per ex:
# print qq|
# $rec{'ID'}</td> #<td>$rec{'Title'}</td># <td>$rec{'Category'}</td> # <td>$rec{'Price'}

i cleared before the db!!!!and uploaded everything in ASCII;and i uploaded the cfg file also!!!!
well you know what i'm gonna have? a chocolat for this aggravation!!
cheerOS
macagy


Quote Reply
Re: Oops!Add syncronization problem In reply to
Hi macagy, believe me, it is just as frustrating at my end - not seeing the actual files to be able to spot out such errors before they become a problem for you :-) Uploading your files as text docs would sure make it easier to help you out :-)

Okay, in your example - there are many errors.
# print qq|
# $rec{'ID'}</td> #<td>$rec{'Title'}</td># <td>$rec{'Category'}</td> # <td>$rec{'Price'}

# = a comment
perl will not "read" and follow instructions which are placed on a line which has been commented out.
# That's how the instructions
# can be added inside a perl
# script. Perl won't read the
# lines which are commented.

</td><<< this portion is ending (closing) the data cell #<<< this pound sign cannot appear hear because it is following the closed data cell and appears before the next data cell begins >>><td>

This line should look something like:

print qq|
$rec{'ID'}</td><td>$rec{'Title'}</td><td>$rec{'Category')</td><td>$rec{'Price'}

I'm guessing here that you have the short/long mod added and that mod has the opening <table><tr><td> & the closing </td></tr></table> tags in the header and footer.



Quote Reply
Re: Oops!Add syncronization problem In reply to
Hi Karen,
i knew # this is start a comment but Dum Dum as i am i got confused by Carol phrase<PLEASE DO NOT REMOVE THIS>
promiss i won't do it again even if Alex has a change of heart re: Perl!!!!!
Now easy html stuff!Here a sample of my List_All creen:
================
Your search returned 3 matches.

ID TITLE CATEGORY PRICE DATE

32 car on sale Product $4000 14-Sep-2000
33 consulting Service $5000 14-Sep-2000
34 software developer Employment $200000 14-Sep-2000


| Home | Add | View | List All | Log Off |

======================
Here my html_record portion:
print qq|
<a href="$long_url">$rec{'ID'}</a>
|;

# if you want to display your fields in columns, use the following format:
print qq|

$rec{'Title'}</td> <td>$rec{'Category'}</td> <td>$rec{'Price'}</td> <td>$rec{'Date'}|;
=====================
and this is my html_view_success
# html_record for printing.
if ($maxhits == 1) {
&html_record_long(&array_to_hash(0, @hits));
}

else {
print qq|<p><$font>Your search returned <b>$db_total_hits</b> matches.</font>|;
print qq|<p><$font>ID TITLE CATEGORY PRICE DATE </font>|;
(THIS IS THE LINE I ADDED)
and now
-1-i can't figure out how to space the different "designations"in the header
-2-spacing the different items showing on results ie:
in my ex:32 is too close to the Title and so on...Comprendo!!!
even if stumble on those stupids steps i undertake i got a kick out of working on Dbman;True!! my dad decided we're sticking to it!Cool!!!he sent the payment to Alex
What the heck! from here on, it seems like more of cosmetics will be needed,add to that the potential this DBman offers, we figured that'll do.WE're happy with it!!!
cheerOS
macagy





Quote Reply
Re: Oops!Add syncronization problem In reply to
Hello macagy, this should be just a matter of html coding to alter the display as you would like. You can try adding nonbreakingspace (a blank space) in each of the datacells to get the positioning you want.

I cannot post the exact code because the page display will interpret it as html and remove it. The code is & nbsp; (remove the blank space between the & and n)
I'll use nbsp; in the following code snippet you provided to give you an example.

nbsp;nbsp;$rec{'Title'}</td> <td>nbsp;nbsp;$rec{'Category'}</td> <td>nbsp;nbsp;$rec{'Price'}</td> <td>nbsp;nbsp;$rec{'Date'}|;

Hope this helps.