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-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

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

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 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 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 Graham Cossey
What about doing something like: $sql = "SELECT * FROM my_table WHERE col1=$var1"; if (isset($var2)) $sql .= " AND col2='$var2'"; HTH Graham > -Original Message- > From: Stuart Felenstein [mailto:[EMAIL PROTECTED] > Sent: 10 November 2004 14:37 > To: [EMAIL PROTECTED] > Subjec

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 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