PROTECTED]
Sent: Saturday, November 13, 2004 1:16 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Help: Database Search
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
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
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
--- 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
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 event one
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 redundant
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]
Subject: [PHP]
--- 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 share a
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 correct
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 results
10 matches
Mail list logo