Search found 41 matches

by WLW
Sun Sep 12, 2004 6:37 am
Forum: Databases
Topic: Search two or more tables
Replies: 9
Views: 633

Thanks for the reference, but it really didn't help my PHP problem. Can someone, in plain English, explain what each bit of that PHP code is doing? I can't tell what parts of the code need to be changed to suit my situation, or where the code gets placed on my page. mysql_select_db($database_connHP4...
by WLW
Fri Sep 10, 2004 10:04 pm
Forum: Databases
Topic: Search two or more tables
Replies: 9
Views: 633

A member on another board suggested the following: while (($row = mysql_fetch_array($result))){ if ($memno != $row["memno"]) { $memno = $row["memno"]; } //add more code here $memno = $row["memno"]; } //end while loop I don't understand (conceptually) how this code works.
by WLW
Thu Sep 09, 2004 1:11 pm
Forum: Databases
Topic: Search two or more tables
Replies: 9
Views: 633

Technically, there are no duplicate records as such. All are unique. Therefore the DISTINCT parameter has no effect on the output. Prior to including the new table via LEFT JOIN, there were 8 records in the database, one for each unique memno . After the join there are 11 records. Now, record 2 is a...
by WLW
Thu Sep 09, 2004 11:04 am
Forum: Databases
Topic: Search two or more tables
Replies: 9
Views: 633

The LEFT JOIN worked, so now I just need to be able to remove the duplicates on the displayed page.
by WLW
Thu Sep 09, 2004 8:47 am
Forum: Databases
Topic: Search two or more tables
Replies: 9
Views: 633

When I join the tables, I run into another problem, (besides the duplicates). The resulting display when there is no search being done, instead of showing all the records (including the duplcates added from the join) is only showing records that coincide with the data in the specialmem table. But, t...
by WLW
Thu Sep 09, 2004 7:42 am
Forum: Databases
Topic: Search two or more tables
Replies: 9
Views: 633

Search two or more tables

I'm not sure if this question belongs in this forum or the PHP Programming forum. I have a recordset called rs_members, that uses columns from a table called members. From this recordset, I set up simultaneous searches on columns for lastname, gender, eye color, hair color, age plus a few other colu...
by WLW
Wed Sep 08, 2004 6:17 am
Forum: Databases
Topic: Search all except...
Replies: 12
Views: 1091

Do you mean, change:

$my_sing = ""; //set default

to:

$my_sing = "%"; //set default
by WLW
Tue Sep 07, 2004 11:45 pm
Forum: Databases
Topic: Search all except...
Replies: 12
Views: 1091

You mean if the page is accessed directly without going first thru the search form?
by WLW
Tue Sep 07, 2004 11:35 pm
Forum: Databases
Topic: Search all except...
Replies: 12
Views: 1091

The form dropdown list is: <select name="sing1" id="sing1"> <option value="%" selected>--</option> <option value="n/a">All Singers</option> <option value="Soprano">Soprano</option> <option value="Mezzo-Soprano">Mezzo-Soprano</option> <optio...
by WLW
Tue Sep 07, 2004 11:14 pm
Forum: Databases
Topic: Search all except...
Replies: 12
Views: 1091

I found another approach that works perfectly: //array of all possible VALID singer types $sing_type = array("%","n/a","Soprano","Mezzo-Soprano","Alto","Tenor","Baritone","Bass"); $my_sing = ""; //set default /...
by WLW
Mon Sep 06, 2004 3:36 pm
Forum: Databases
Topic: Search all except...
Replies: 12
Views: 1091

Unfortunately, I am not very familiar with the PHP coding necessary to create the dynamic statement that means: If 'sing1' is equal to "ALL" then append the SQL WHERE statement with SINGER != 'n/a', otherwise append with SINGER LIKE 'sing1%' Can you help me with that scripting? I think the...
by WLW
Mon Sep 06, 2004 1:44 pm
Forum: Databases
Topic: Search all except...
Replies: 12
Views: 1091

I think WHERE SINGER LIKE 'sing1%' can work to allow either a specific singer choice (if 'sing1' is 'Alto' or 'Soprano', etc.) OR the default of show all (if 'sing1' is %), but when "All Singers" is selected, what value gets passed as 'sing1' in order to exclude 'n/a' from the search? The ...
by WLW
Mon Sep 06, 2004 12:15 pm
Forum: Databases
Topic: Search all except...
Replies: 12
Views: 1091

Search all except...

I have a database with a newly added column called SINGER. The column can contain any of a dozen or so items (alto, soprano, etc.) selected from a dropdown list. One of those items is n/a , meaning that this person is NOT a singer. On the search form I want to add an option to search for singers by ...
by WLW
Thu Aug 12, 2004 9:31 am
Forum: Databases
Topic: Confused about default values when using WHERE statement.
Replies: 50
Views: 2008

Thank you very much pickle and feyd!! All is working as expected now. Let me know if you'd like to see the sample. :D
by WLW
Wed Aug 11, 2004 7:53 pm
Forum: Databases
Topic: Confused about default values when using WHERE statement.
Replies: 50
Views: 2008

Does that mean then that I need to add similar phrases for the 6 new items we are working with?

Regarding the SQL problem... Ignor that. I fixed it. The new chunk of PHP code was in the wrong place on the page.