RE: Select statement not working

From: Date: Fri, 20 Apr 2001 09:06:34 +0000
Subject: RE: Select statement not working
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-6911@lists.php.net to get a copy of this message
I've had almost exactly the same problem - in access the query returns all the fields that should be there, but use that SQL string in a php script and I only get a few (or none) of the results. I am not where the erroneous source is at the moment - I'll post it to the list when I get there, but it is perplexing because I'm using the same code as I've used elsewhere, of the form: $res = odbc_exec ($connect, $query); while (odbc_next_field [[or whatever]] ($res)) { print (odbc_fetch ($res, "field")); } I've used this successfully in other situations, but I think the difference here may be that it's accessing the mdb file through a shared drive. What's even weirder is that I have a php script that I run standalone that queries an access db through a shared drive and that works fine! I am using php 4.0.4 (CGI) on win2k on IIS 5, so it doesn't seem to be an apache problem. I will send again when I have a better example of what I wrote. Martin > -----Original Message----- > From: Nick Allen [mailto:nick.allen@tbwa-europe.com] > Sent: 19 April 2001 1:13 > To: php-windows@lists.php.net > Subject: Select statement not working > > > Can't seem to troubleshoot this one... > > WinNT4.0 > PHP4.0.3 cgi > Apache (latest) > > Code queries an Access database via ODBC and returns an empty dataset > although there are definately records in there. Connection is fine - no > errors and a valid connection handle is returned. > > echoing the query string to the page and then copying/pasting > that directly > into the sql edit section of the query builder in MSAccess works fine. > > Query is so simple it hurts: > > SELECT txtIntCategory FROM tblIntCategory; > > yet it returns *NOTHING*!! > > Identical Access query returns 8 string values. > > Any ideas or known bugs? > > TIA. > > Nick. > > > >

« previous php.windows (#6911) next »