Hi, ive read the previous posts about the unique function and realize that it searches for unique rows and not a specific column. My problem is that i have a unique id which i need to display for each row but i only want to display some unique columns. IE:
TABLE: ID | name | state
1 john Alabama
2 john California
3 john Alabama
my $sth = $table->select ( { Name => $IN->param('Name') }, ['DISTINCT(Name)', 'ID', 'State'] );
this will result in all 3 rows returned cause they all have a unique ID. I just want rows 1 and 2 returned.
Any idea on how to solve this?
Also my form has many fields for this example lets use 2, name and state.
If the user wants to search for john in alabama ive tryed to create a string
my $str= "Name => $IN->param('Name'), State => $IN->param('State')";
my $sth = $table->select ( { $str }, ['DISTINCT(Name)', 'ID', 'State'] );
This does not work, any ideas on how to include multiple conditions?
Thanks
Hagai
TABLE: ID | name | state
1 john Alabama
2 john California
3 john Alabama
my $sth = $table->select ( { Name => $IN->param('Name') }, ['DISTINCT(Name)', 'ID', 'State'] );
this will result in all 3 rows returned cause they all have a unique ID. I just want rows 1 and 2 returned.
Any idea on how to solve this?
Also my form has many fields for this example lets use 2, name and state.
If the user wants to search for john in alabama ive tryed to create a string
my $str= "Name => $IN->param('Name'), State => $IN->param('State')";
my $sth = $table->select ( { $str }, ['DISTINCT(Name)', 'ID', 'State'] );
This does not work, any ideas on how to include multiple conditions?
Thanks
Hagai