close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Simple checkbox on Results page issue

Thread began 7/05/2011 9:17 am by Jared Lui | Last modified 7/07/2011 7:07 am by Jason Byrnes | 1937 views | 7 replies |

Jared Lui

Simple checkbox on Results page issue

I am using an INSERT page to successfully add a Y or N value to my database "Approved" column using a checkbox.

I have the checkbox working correctly on the UPDATE and DELETE pages. And it shows fine in the results table correctly.

My issue is between the SEARCH and RESULTS where the filter is concerned. My results table is showing all records ignoring the "Approved" column.

I have the Search checkbox checked by default so that is always show all approved results.

This is from saerch.php:
<input name="Approved" type="checkbox" id="Approved" value="Y" checked="checked" />

This is the business end of the search URL:
Results.php?S_Line_Name=&S_Line_Nickname=&S_Start_Decade=&S_End_Decade=&S_Manufacturer=&S_Size=&S_Cat_1=&Approved=Y&S_Added_By=&S_Line_Text=&Search.x=30&Search.y=20&Search=Search

This is the comparison list additions how I would think it would work:
$WADbSearch1->addComparisonFromCheck("Approved","S_Approved","Y","","AND","=","=",1);

Used column type: boolean; Type: Check; check field name: S_Approved; Checked value: = Y

Tried many different combinations and none worked. Did some forum searches and found someone having simular issues and they were told to use: Type Edit and make sure Search value is Y. That didn't help me.

I know I am missing something simple but I am over looking it obviously.

I want to be able to have my search only return those records that have a Y in the Approve column.

Thanks in advance for your help.

Sign in to reply to this post

Jason ByrnesWebAssist

send a copy of the results page please.

Sign in to reply to this post

Jared Lui

Here is the results file.

Attached Files
figure_lines_Results.zip
Sign in to reply to this post

Jason ByrnesWebAssist

when troubleshooting search issues, the first thing is to add code to your page to output the SQL being executed.

add the following code just after the <body> tag on your page:

php:
<?php echo"SQL: ".$query_limit_WADAfigure_lines."<br />"); ?>



and post back the sql being executed, the search querystring is also helpfull as well.

Sign in to reply to this post

Jared Lui

Here is the SQL. I normally add this to my search pages and leave it there, a tip I picked up from you awhile back.

SQL: SELECT Line_Id, Line_Name, Line_Nickname, Start_Decade, End_Decade, Manufacturer, Size, Cat_1, Cat_2, Cat_3, Approved, Locked, Added_By, Line_Text FROM figure_lines WHERE (Approved = 0) AND (Locked = 0) ORDER BY Line_Name ASC LIMIT 0, 10

I know the WHERE statement is saying "= 0" but I don't see where that is happening. Maybe I am thinking about this wrong but I though by having the checked value = Y on the search page that it would send that value in the URL. So I'm guessing the issue is on the Results page?

Thanks.

Sign in to reply to this post

Jason ByrnesWebAssist

in the DataAssist Search wizard, the Column Type for the Approved and Locked column criteria is set to Number/Boolean. change it to text.

Sign in to reply to this post

Jared Lui

Thanks Jason. That solved half of my issue. I keep mistakenly associating Y/N with Boolean but think I'll remember from now on.

BTW, my David Powers books should arrive today and I took the SQL course in W3Schools and started the Javascript and Php lessons. Great advice!

My other issue was noticing once I change Boolean to text that the SQL was returning "=N" regardless of what the searched check boxes were. I left off the "S_" in the check field name. I new I was missing simple items. A hazard for a noob trying to retrofit after the fact.

Thanks again Jason.

Sign in to reply to this post

Jason ByrnesWebAssist

no worries, glad to hear you got it working.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...