RE: [PHP] Re: Help: Database Search

2004-11-13 Thread Stuart Felenstein
--- 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. > Y

RE: [PHP] Re: Help: Database Search

2004-11-13 Thread Graham Cossey
From: Stuart Felenstein [mailto:[EMAIL PROTECTED] > Sent: 13 November 2004 13:31 > To: [EMAIL PROTECTED] > Subject: Re: [PHP] Re: Help: Database Search > > > > --- Jason Wong <[EMAIL PROTECTED]> wrote: > > Yes, that was apparent from your previous post. So > > did

Re: [PHP] Re: Help: Database Search

2004-11-13 Thread Jason Wong
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 Ven

Re: [PHP] Re: Help: Database Search

2004-11-13 Thread Stuart Felenstein
--- 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 IN(1','2','3','4','5','6','7','8','9','10','1

Re: [PHP] Re: Help: Database Search

2004-11-13 Thread Stuart Felenstein
--- 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 PostStar

Re: [PHP] Re: Help: Database Search

2004-11-13 Thread James Kaufman
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. > > $sql = 'SELECT PostStart, JobTitle, Industry, > LocationState, VendorID > FROM VendorJob

Re: [PHP] Re: Help: Database Search

2004-11-13 Thread Jason Wong
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. > > $where = array(); > $Ind[] = ""; Not sure why you're adding an empty element to $Ind? > print_r($Ind); > //Array

Re: [PHP] Re: Help: Database Search

2004-11-13 Thread Stuart Felenstein
--- 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

Re: [PHP] Re: Help: Database Search

2004-11-13 Thread Jason Wong
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 n

Re: [PHP] Re: Help: Database Search

2004-11-13 Thread Stuart Felenstein
--- 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.

Re: [PHP] Re: Help: Database Search

2004-11-13 Thread Jason Wong
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

RE: [PHP] Re: Help: Database Search

2004-11-13 Thread Stuart Felenstein
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 > $where = array(); > $Ind[] = ""; > $

RE: [PHP] Re: Help: Database Search

2004-11-13 Thread Stuart Felenstein
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" 1) { $IndStr = implode("','", $Ind); $where[] = "V

RE: [PHP] Re: Help: Database Search

2004-11-12 Thread Graham Cossey
tends to run faster 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 > > > &

RE: [PHP] Re: Help: Database Search

2004-11-12 Thread Stuart Felenstein
--- 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: ht

RE: [PHP] Re: Help: Database Search

2004-11-12 Thread Graham Cossey
= 2 HTH 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 <[E

Re: [PHP] Re: Help: Database Search

2004-11-12 Thread Stuart Felenstein
--- 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)