Gossamer Forum
Home : Products : DBMan : Customization :

Not getting any search results.

(Page 1 of 3)
> >
Quote Reply
Not getting any search results.
Hi all.
I reconfigured the cfg. page and set some permissions. When I try to search the database, it does not yield any search results! even if I choose an option that I know for sure is there. What did I do wrong?
Quote Reply
Re: Not getting any search results. In reply to
Oh, I forgot tomention one more thing.
If I check "match any" I do get results. Is there a setting I can make the search automatically a "match any" by default? Thanks in advance for your help.

Jay
Quote Reply
Re: Not getting any search results. In reply to
What error message do you get? "No matching records" or "No search terms specified"?



------------------
JPD





Quote Reply
Re: Not getting any search results. In reply to
Yes, you can have it "match any" by default. In sub html_view_search after

<input type=hidden name="uid" value="$db_uid">

add

<input type=hidden name="ma" value="1">



------------------
JPD





Quote Reply
Re: Not getting any search results. In reply to
JPD.
I get no matching records. If you wanna check it out it is here http://www.styleforliving.com/cgi-bin/dbman2/db.cgi?db=default&uid=default I have made a whole bunch of check boxes--thats what I want the search page to look like(well sort of) COuld you tell me how I can go about making further modifications to make it look similar to that? I am going through your tutorial as I am writing this, so perhaps my question will be automatically be answered Smile By the way, Your tutorial has been extremely helpful to me. Without it, I probably haven't been able to get this far... Thanks JPD~~>Is your name Carol??? Why is Eliot calling you Carol??? no biug deal, just wondering.
Quote Reply
Re: Not getting any search results. In reply to
JayR,

JPDeni's name is Carol. I looked at your search form and could not see any syntax errors. I know that searches with checkboxes can be tricky.

May be Carol (JP, JPDeni, Kind Lady) can help you.

Smile

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Not getting any search results. In reply to
Eliot.
Now I know Smile
A newbie question for you: Is the key field absolutely necessary? What happens if I don't have one??? Thanks in advance.

Jay
Quote Reply
Re: Not getting any search results. In reply to
The key field is not necessary for all databases. It depends on what you want your Registered Users to do in your database. I would refer to JPDeni's DBMAN Permission Tutorials for more information on setting your authentication schemes and key fields.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
Quote Reply
Re: Not getting any search results. In reply to
Eliot is wrong. The key field is very necessary. There are things that will not function without it. For example, the add success page is dependent upon the key field, as is the modify record. You *MUST* have a key field.

I think Eliot was thinking of a userid field.

Jay, your problem is undoubtedly due to your checkbox fields. I tried the URL you gave for you site and I got a "File Not Found" error, or I would be able to tell you for sure.

The problem with checkboxes is that you probably have more than one option defined for a checkbox. You can't do that and be able to do searches. You must make a separate field for each checkbox.

If you want me to look at your files to know for sure what the problem is, copy your files (default.cfg and html.pl) to a web-accessible directory -- one where you would place html files -- and rename them to default_cfg.txt and html_pl.txt. Then come back here and tell me where they are and I'll look at them.


------------------
JPD





Quote Reply
Re: Not getting any search results. In reply to
Hi Carol! I looked up your section on ypur site~~~duhh~~~X)
Yeh..I took Eliot's advice and removed the Keys and had problems so I included it. But is there a way I can "hide" the key from viewers???
sorry about the link I changed it its here
http://www.styleforliving.com/cgi-bin/db/db.cgi?db=default&uid=default

I'll load the cfg and pl files in the following dir.
cfg---> styleforliving.com/dbman/default_cfg.txt
html.pl--->
styleforliving.com/dbman/html_pl.txt
Thanks for all your help.

Jay
Quote Reply
Re: Not getting any search results. In reply to
Yes, you can hide the ID from users. Since you're using the autogenerate feature, just set the field length of the ID field to -1.

Now for your checkboxes.

You can have more than one option for a checkbox field, but, as you see, it doesn't look very good on the forms. And, as you found out, it causes a lot of problems with searches.

What you need to do is to take each one of the checkbox options and make a field for it. Then you will have much more control over the look of your form and you will be much more successful in your searches.

To illustrate:

Instead of

Code:
'by Item' => [0, 'alpha', 0, 255, 0, '', '' ],

Make a field of each of the checkbox options:

Code:
Accessories => [ 0, 'alpha', 0, 255, 0, '', ''],
Appliances => [ 1, 'alpha', 0, 255, 0, '', ''],
Armoire => [ 2, 'alpha', 0, 255, 0, '', ''],
Art => [ 3, 'alpha', 0, 255, 0, '', ''],
and so on.

In your %db_checkbox_fields, define your fields like:
Code:
Accessories => 'Accessories(decorative)',
Appliances => 'Appliances(stoves ranges etc.)',
Armoire => 'Armoire/Wardrobes/Entertainment Center',
Art => 'Art/Galleries/Framing',
and so on.

When you get to the point of creating your own forms and displays, you'll be able to make some really nifty looking checkbox fields, instead of the mess that's there now.

------------------
JPD





Quote Reply
Re: Not getting any search results. In reply to
I AGREE. It is totally messy!@ I was hoping to further customize it after I have a working prototype. I am going through your tutorials and it has been extremely helpful. And thank you for all of your support! I'll take your advice and make changes right now.

Jay
Quote Reply
Re: Not getting any search results. In reply to
JP.
If I mke each individual check boxes a separate field, will I have any control over where on the form it will appear? will all of the check boxes be in one vertical column?

Jay
Quote Reply
Re: Not getting any search results. In reply to
You'll get rid of the labels to the left of the checkboxes in the next step.

I was afraid that part of the tutorial wouldn't be clear to everyone. The trouble is that I don't know how to explain it any better.

I just realized that you possibly didn't connect "the code below for each different kind of field" with the sections marked "Text fields," "Select fields," "Radio fields," "Checkbox fields" and "Textareas." Those are the "C" notes I suggested you make on your printout -- the type of field it is.

For example, your Store Name field would be a text field. You'll probably want that right up at the top. So, just after your hidden ID field, add

Code:
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Store Name:</font></TD>
<TD VALIGN="TOP">
<input type="text" name="Store Name" value="$rec{'Store Name'}" size="40" maxlength="255"></TD></TR>

Does that help?

As I say, I can give you a better way of working with your checkbox fields. We can let Perl do some of the work for you.

You had mentioned before that you wanted to have a form that looked like that on another site. Did you want your checkboxes in columns? How many?



Then again, with all of your checkboxes, I think we need to do something a little different.

Could you put your new default.cfg file up on your site? It would make it easier to explain if I have something to look at.

------------------
JPD





Quote Reply
Re: Not getting any search results. In reply to
When you get ready to make your own form, I've got some sneaky ways of making it a lot quicker to create the form instead of typing all of that stuff in. Just remind me of it when the time is right.


------------------
JPD





Quote Reply
Re: Not getting any search results. In reply to
JP.
How do I get rid of the fieldname to the left of checkbox??
Definitely the search results are more accurate!

My next questionis from our tutorial on "create your own forms and displays" What do you mean by the following statement??
"Next, add all the other fields, in the order you want them listed on your form. Don't worry about any "admin-only" fields right now. We'll get to them in a bit. Again, copy the code below for each different kind of field and paste it into sub html_record_form, between the <TABLE... and </TABLE> tags, substituting the letters in bold print for the values on your printout from the default.cfg file. Make sure that you enter an input field on your form for every field in your database. "

Jay

Quote Reply
Re: Not getting any search results. In reply to
JP.
I made the form length on the ID field to -1 and its gone.

When I administer like adding a record, I also have no ID field. Does this mean I no longer have a key?? or is the ID there but just not visible.

Jay
Quote Reply
Re: Not getting any search results. In reply to
If you are still using autogenerate, the field is still there. It's just hidden. Take a look at the source code of the form in your browser and you'll see there's a hidden field with the name of "ID."

However -- and this is a very big however -- when you make your own forms, you *must* include the hidden field in your form.


------------------
JPD





Quote Reply
Re: Not getting any search results. In reply to
Carol.
What do you mean " a big However"?? Is it that difficult to modify the form?? Even with your help??

Jay
Quote Reply
Re: Not getting any search results. In reply to
JP.
The following is a link to my mock search(I wanna add a keyword search on the bottom) form styleforliving.com/furnishings/index.htm

the new form with the modified(from my last messy check boxes) form with the new check boxes are here
http://www.styleforliving.com/cgi-bin/db/db.cgi?db=default&uid=default

and for the updated cfg source code,
styleforliving.com/dbman/default_cfg.txt

I haven't found any errors to my knowledge...Could you look at it tell me if I am OK for your next phase of the tutorial to modify my form?

Always thankful for your insights,
Jay
Quote Reply
Re: Not getting any search results. In reply to
What Carol means is that you have to include the "hidden" fields for the .cfg and userid in your modified search forms. It is possible to create static web search forms. But you have to include the following hidden fields:

Code:
<input type="hidden" name="db" value="default">
<input type="hidden" name="uid" value="default">

The form seems to work. I checked Bedroom and it came up with the record.

Regards,

------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us

[This message has been edited by Eliot (edited August 26, 1999).]
Quote Reply
Re: Not getting any search results. In reply to
What I mean about the "big however" is that you need to include a hidden field for the ID in your sub html_record_form for adding and modifying your data. You don't need to worry about it with the search form, if you have a separate subroutine for the search or if you are using a static html page.

(BTW, sorry I didn't get back to you earlier. I had to spend the afternoon with my mother-in-law. Smile )

It is not difficult to modify the form. It's just that people forget to add hidden fields to their forms and get into all sorts of trouble that way.

Your form and .cfg file look great. You're doing very well! Smile


------------------
JPD





Quote Reply
Re: Not getting any search results. In reply to
JP.
I am still unsure of the underlying "principle" of dbMan. For example, there are things on the search form I don't want to appear but still have those fields showing up on the search results. If you look on my form, the "store description" (http://styleforliving.com/cgi-bin/db/db.cgi?uid=default) should only show up on the results, not on the actual form itself... Am I jumping the gun here with question that will be answered once I start modifying the form?? Thanks JP. I thought you were getting sick of me asking so many newbie questions, so not writing back to me anymore Smile

Jay
Quote Reply
Re: Not getting any search results. In reply to
No. It takes a lot more than this to make me sick of you. (My m-i-l got a new television and couldn't figure out how to get it to work. My choice was to listen to her complain about how she didn't know what to do with it, or go over there and show her. Smile )

I understand what you mean about people not being able to search on the store description field. That makes perfect sense. But you do need to have the description field within html_record_form so that you can input the store description when you add the record and so you can modify it if you need to.

First, build your sub html_record_form with all of your fields in it. Make sure it works perfectly. After that, we'll make a separate form for searching that only lists the fields you want people to be able to search on. Make sense?


------------------
JPD

PS -- I almost forgot to ask. When you had your "messy" checkboxes, you had three different ones -- by Type, by Room(?) and by Style. Do you still want to group your checkboxes in that way -- with different categories? Do you want to have three columns of checkboxes?



[This message has been edited by JPDeni (edited August 26, 1999).]
Quote Reply
Re: Not getting any search results. In reply to
JPD.
The three groupings: "by Item, by Room, and by Style" are gropu that I'd like to divide up all the checkboxes into. If you wanna see my mock page on it here it is
styleforliving.com/furnishings/index.htm
that's how I'd like the final version to look like with an additional keyword search field at the end of it. What do ya think??

Jay
> >