RE: [PHP] Help: Database Search

2004-11-15 Thread Gryffyn, Trevor
you're checking in your WHERE clause, the less work your DB server has to do. HTH -TG > -Original Message----- > From: Stuart Felenstein [mailto:[EMAIL PROTECTED] > Sent: Saturday, November 13, 2004 1:16 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] Help: Database

[PHP] Re:[SOLVED] [PHP] Help: Database Search

2004-11-13 Thread Stuart Felenstein
--- Stuart Felenstein <[EMAIL PROTECTED]> wrote: Okay, so what did I learn. 1) That a comma delimited list (from the array) to be used correctly in the sql statement had to use the IN word. $sql .= " WHERE VendorJobs.Industry IN ($s_Ind)"; 2) I need a space between the first quotation in the

Re: [PHP] Help: Database Search

2004-11-13 Thread Stuart Felenstein
I've changed my logic around but still running into a sql query error. I've tried a number of things with no success. Here is the error that returns on POST: SELECT PostStart, JobTitle, Industry, LocationState, VendorID FROM VendorJobs WHERE (VendorJobs.Industry = ''1','2','3''Query failed: You h

Re: [PHP] Help: Database Search

2004-11-10 Thread Stuart Felenstein
--- Jason Wong <[EMAIL PROTECTED]> wrote: > Why not build your sql query according to whether or > not whatever you want is > selected or not. That way debugging is easier as > you won't be looking at > queries that contain redundant "... AND 0 ...". > Jason, How would I do that ? Care to sh

RE: [PHP] Help: Database Search

2004-11-10 Thread Graham Cossey
ember 2004 14:37 > To: [EMAIL PROTECTED] > Subject: [PHP] Help: Database Search > > > I am creating a database search form and results. > Running into a problem though. > I have two form elements, both that are fed by tables > that have int values (1, 2 , etc) > > my sql sta

Re: [PHP] Help: Database Search

2004-11-10 Thread Jason Wong
On Wednesday 10 November 2004 15:37, Stuart Felenstein wrote: > --- Jason Wong <[EMAIL PROTECTED]> wrote: > > Why not build your sql query according to whether or > > not whatever you want is > > selected or not. That way debugging is easier as > > you won't be looking at > > queries that contain

Re: [PHP] Help: Database Search

2004-11-10 Thread Jason Wong
On Wednesday 10 November 2004 14:37, Stuart Felenstein wrote: > But if the user decides to only use one of the > elements, then I don't want the query to return > nothing because of the "And" in the where clause so I > have these 2 statements that set a default value > (shown here as 0 in the even

Re: [PHP] Help: Database Search

2004-11-10 Thread Stuart Felenstein
--- Jon Hill <[EMAIL PROTECTED]> wrote: > You might want to try looking up the syntax for left > join queries. > I think this might be what you are after. > > http://dev.mysql.com/doc/mysql/en/JOIN.html > It has nothing to do with left joins. It works fine provided I do one of two things, make

Re: [PHP] Help: Database Search

2004-11-10 Thread Jon Hill
You might want to try looking up the syntax for left join queries. I think this might be what you are after. http://dev.mysql.com/doc/mysql/en/JOIN.html On Wednesday 10 November 2004 14:37, Stuart Felenstein wrote: > I am creating a database search form and results. > Running into a problem thou

[PHP] Help: Database Search

2004-11-10 Thread Stuart Felenstein
I am creating a database search form and results. Running into a problem though. I have two form elements, both that are fed by tables that have int values (1, 2 , etc) my sql statement is such: SELECT vendorjobs.PostStart, vendorjobs.JobTitle, vendorjobs.Industry, vendorjobs.VendorID, vendorjobs

Re: [PHP] Help: Database search and results

2004-10-24 Thread Stuart Felenstein
Ooops, not solved yet. --- Stuart Felenstein <[EMAIL PROTECTED]> wrote: I have created a database search and results set. Things seem to work fine until I add the join statements into the results page query string. If I don't use the joins , the search works great. It returns the correct result

[PHP] SOLVED Re: [PHP] Help: Database search and results

2004-10-24 Thread Stuart Felenstein
Wow~! I'm getting good. --- Stuart Felenstein <[EMAIL PROTECTED]> wrote: > I have created a database search and results set. > Things seem to work fine until I add the join > statements into the results page query string. > If I don't use the joins , the search works great. > It > returns the c

[PHP] Help: Database search and results

2004-10-24 Thread Stuart Felenstein
I have created a database search and results set. Things seem to work fine until I add the join statements into the results page query string. If I don't use the joins , the search works great. It returns the correct results based on the criteria input. If I add the joins in, then basically all