CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 How do I search for a value in one field with 2 parameters

Print topic Send  topic

Author Message
capone
Posted: 02/12/2004, 7:10 AM

Hi All,
I need help on a search form.. this is where i have mysql data table called people, and a field in there called age.

Now i want to search for an age range when i select the values from 2 listboxes name s_age and s_age1.

Now i have set the neccessary parameters within the table/view i even use the SQL too to set the following parameters
age =>{s_age} AND age<= {s_age1} as quoted from the dialogbox menu..

It never seems to work it just gives me the value within the s_age listbox since it's automatically recognises the s_age only .
I have tried using differently tagged listbos with a controlsource and yet still it gives me all ages in the table people.

Please i need you pro advice on how to solve this problem...
Thank you...
Lucky
Posted: 02/12/2004, 9:36 AM

Same problem I have but with date field.
I have one date field, but I'd like to list data from one date to another.
Ex: from 01/01/2003 to 31/12/2003
I've made to fields with
date =>{s_date1} AND age<= {s_date2}
but I'm not getting any result.
I need this urgently
Any help or idea could be appreciated
By Lucky
peterr


Posts: 5971
Posted: 02/12/2004, 7:17 PM

There is usually only requirement needed to make this work:
In the Grid parameters dialog you need to enter the name of your Listbox in the "Parameter source" field. For example "s_age1" or "s_date2" (without quotes).

If this doesn't work for you then:
1. Check the name of your ListBoxes - are they the same as specified in the Grid parameters?
2. Check the URL that is being shown in your browser when you execute the search. Does the URL contain both listbox name with values? If yes, then the problem is in the Grid. If not, then the problem is in the Search form.
3. If you are unable to make this work and you are a current CCS user, contact our support and later email a sample project or page.

_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
capone
Posted: 02/16/2004, 7:38 AM

Hi Peterr..
Thank you for your deep concern but I have done all you ' ve suggested
1. specifying the listboxes names in the parameter source without
quotes.

2. They all have their names correctly named in the Grid parameters.

3. The url in the browser shows all paramters as named [ http://localhost/peoples/people.php?s_age=18&s_age1=35]

Please I'm not new to codecharge i have been using this software since 2001.. Please help me since i cannot finish this project if i can create a search querry...
thank you...
Don Safar
Posted: 02/16/2004, 9:27 AM

This might help you to debug. Find the Open Function for your grid. Look for
a line like the following
$this->query(CCBuildSQL($this->SQL, $this->Where, $this->Order));

Right below it this line do

echo CCBuildSQL($this->SQL, $this->Where, $this->Order);
exit;

Review the where clause to make sure it is formatted like you think it
should be. If it is not, then you have a problem in the way you setup the
sql and/or where parameters. If it is correct, Copy the sql from the browser
and run it against your database. Does it work? if it does, then I would
suggest opening up a support ticket. If it doesn't, then you need to rework
you sql and/or where parameters in query builder.

"capone" <capone@forum.codecharge> wrote in message
news:54030e3f3ef136@news.codecharge.com...
> Hi Peterr..
> Thank you for your deep concern but I have done all you ' ve suggested
> 1. specifying the listboxes names in the parameter source without
> quotes.
>
> 2. They all have their names correctly named in the Grid parameters.
>
> 3. The url in the browser shows all paramters as named [
http://localhost/peoples/people.php?s_age=18&s_age1=35]
>
> Please I'm not new to codecharge i have been using this software since
2001.. Please help me since i cannot finish this project if i can create a
search querry...
> thank you...
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

peterr


Posts: 5971
Posted: 02/16/2004, 3:09 PM

capone,
Could you please also describe how did you setup your 2 parameters in your Grid. Basically the following:
Field Name:
Field Type:
Condition:
Parameter Name:
Paramatere Type:

Thanks
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
capone
Posted: 02/17/2004, 6:08 AM


Field Name = age
Field Type = Integer
Condition = "greater than or equal =>"
Parameter Name =s_age
parameter type = URL

AND

Field Name = age
Field Type = Integer
Condition = "less than or equal <="
Parameter Name =s_age1
parameter type = URL

Thank you for your concern....
peterr


Posts: 5971
Posted: 02/18/2004, 12:50 AM

capone,
I don't understand why this may not work, therefore you should probably go ahead and submit a support case to http://support.codecharge.com .
You may attach a sample page and relevant database table structure.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
by Lucky
Posted: 02/21/2004, 3:45 AM

I have resolved my problem. It was format issue.
Problem was that I was saving dates in datetime field in general format, but I didn't know that MySQL is saving date by default 0000/00/00.

Thanks a lot Peter

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.