This content has been marked as final.
Show 3 replies
-
1. Re: SEARCH AND RESULT IN THE SAME PAGE
Newsgroup_User Jul 22, 2007 10:09 AM (in response to oicram)oicram wrote:
> As I have the results appearing on the same page as search function, the show
> if recordset is empty will not properly work, since the "No Records Match Your
> Criteria" message will appear as soon as you open the page.
This is a failing of the way the Show if recordset is empty server
behavior, but it's easy to remedy.
> how do I get this message to only show after the user have searched?
The code as inserted by Dreamweaver looks like this (recordsetName will
be replaced by whatever name you gave your recordset):
<?php if ($totalRows_recordsetName == 0) { // Show if recordset empty ?>
Change it like this:
<?php if (array_key_exists('submitButtonName', $_POST) &&
$totalRows_recordsetName == 0) { // Show if recordset empty ?>
Replace submitButtonName with the name of the submit button in your
search form. That's all there is to it.
--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
2. Re: SEARCH AND RESULT IN THE SAME PAGE
oicram Jul 22, 2007 6:12 PM (in response to oicram)
<?php if (array_key_exists('submitButtonName', $_POST) &&
$totalRows_recordsetName == 0) { // Show if recordset empty ?>
Thanks a lot. Its precious to know php at least make a if with a nice array_key_exists. :)
I have change the $_POST to $_GET since my form is getting, and it works perfectly.
Thanks a lot. -
3. Re: SEARCH AND RESULT IN THE SAME PAGE
Newsgroup_User Jul 23, 2007 2:50 AM (in response to oicram)oicram wrote:
> I have change the $_POST to $_GET since my form is getting, and it works
> perfectly.
Glad to have been of help.
--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/

