I think I'm almost there :)
Only right now I'm getting an error message:
Query failed: You have an error in your SQL syntax.
Check the manual that corresponds to your MySQL server
version for the right syntax to use near '' at line 3
?php
$where = array();
$Ind = ;
$Ind = $_POST['Ind'];
if
Sorry, I fixed Ind , since the element is named Ind[].
Now I get a different error:
Query failed: You have an error in your SQL syntax.
Check the manual that corresponds to your MySQL server
version for the right syntax to use near
'','','Array)' at line 3
?php
$where = array();
$Ind[] = ;
On Saturday 13 November 2004 20:41, Stuart Felenstein wrote:
Sorry, I fixed Ind , since the element is named Ind[].
Now I get a different error:
Query failed: You have an error in your SQL syntax.
Check the manual that corresponds to your MySQL server
version for the right syntax to use near
--- Jason Wong [EMAIL PROTECTED] wrote:
Uhmm, you could try some debugging of your own
instead of relying on the list.
Liberally douse your code with print_r() and
var_dump() of all your important
variables. Do they contain what you expected? If not
try and figure out why
not.
--
On Saturday 13 November 2004 21:10, Stuart Felenstein wrote:
Okay, took your advice, but it seems to be a sql error
as the message says.
Query failed: You have an error in your SQL syntax.
Check the manual that corresponds to your MySQL server
version for the right syntax to use near
--- Jason Wong [EMAIL PROTECTED] wrote:
Yes, that was apparent from your previous post. So
did you print out your
query and examine it for any obvious mistakes? And
if you couldn't spot any
obvious mistakes then the least you could have done
was to copy and paste the
full query in your
On Saturday 13 November 2004 21:31, Stuart Felenstein wrote:
It was not apparent whatsoever. Let me show the code
again , but I'll include the print_r returns inline
code.
?php
$where = array();
$Ind[] = ;
Not sure why you're adding an empty element to $Ind?
print_r($Ind);
//Array (
Stuart,
On Sat, Nov 13, 2004 at 05:31:06AM -0800, Stuart Felenstein wrote:
It was not apparent whatsoever. Let me show the code
again , but I'll include the print_r returns inline
code.
?php
$sql = 'SELECT PostStart, JobTitle, Industry,
LocationState, VendorID
FROM VendorJobs
--- Jason Wong [EMAIL PROTECTED] wrote:
See the Array (also missing a single-quote),
that's element [30] mentioned
above.
Summary: the missing single-quotes are the
show-stopper.
I see that , but I'm not sure how that is happening.
Here is the sql:
$sql = 'SELECT PostStart,
--- James Kaufman [EMAIL PROTECTED]
wrote:
Right here, print the contents of $sql. That is the
most important thing to
know right now.
SELECT PostStart, JobTitle, Industry, LocationState,
VendorID FROM VendorJobs WHERE VendorJobs.Industry
On Saturday 13 November 2004 22:14, Stuart Felenstein wrote:
Summary: the missing single-quotes are the
show-stopper.
I see that , but I'm not sure how that is happening.
Here is the sql:
$sql = 'SELECT PostStart, JobTitle, Industry,
LocationState, VendorID
FROM VendorJobs
: Re: [PHP] Re: Help: Database Search
--- Jason Wong [EMAIL PROTECTED] wrote:
Yes, that was apparent from your previous post. So
did you print out your
query and examine it for any obvious mistakes? And
if you couldn't spot any
obvious mistakes then the least you could have done
--- Graham Cossey [EMAIL PROTECTED] wrote:
Hi Stuart
Not sure what's happening with the $Ind variable,
maybe check the $_POST
array as you enter the script to ensure that the
form is passing the data
correctly. It is almost as if you are appending it
to itself at some point.
You don't
--- Sebastian Mendel [EMAIL PROTECTED] wrote:
$where = array();
if ( isset($_POST['Ind']) ) {
$where[] = 'vendorjobs.Industry = ' . (int)
$_POST['Ind'];
}
if ( isset($_POST['Days']) ) {
$where[] = 'Date_Sub(Curdate(), interval ' .
(int) $_POST['Days'] .
' day) =
Graham
-Original Message-
From: Stuart Felenstein [mailto:[EMAIL PROTECTED]
Sent: 12 November 2004 12:42
To: Sebastian Mendel; [EMAIL PROTECTED]
Subject: Re: [PHP] Re: Help: Database Search
--- Sebastian Mendel [EMAIL PROTECTED] wrote:
$where = array();
if ( isset($_POST
--- Graham Cossey [EMAIL PROTECTED] wrote:
This should result in:
WHERE vendorjobs.Industry IN (2,3,5)
OR
WHERE vendorjobs.Industry = 2
HTH
Graham
Not sure what you mean by the above ?
Stuart
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
as well.
Graham
-Original Message-
From: Stuart Felenstein [mailto:[EMAIL PROTECTED]
Sent: 12 November 2004 14:13
To: Graham Cossey; Sebastian Mendel; [EMAIL PROTECTED]
Subject: RE: [PHP] Re: Help: Database Search
--- Graham Cossey [EMAIL PROTECTED] wrote:
This should result
Stuart Felenstein wrote:
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,
18 matches
Mail list logo