Re: odbc msaccess php5 [Giving Up]
| From: | Peter Jackson | Date: | Sun, 06 Jul 2008 12:32:15 +0000 |
| Subject: | Re: odbc msaccess php5 [Giving Up] | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-276336@lists.php.net to get a copy of this message | ||
Peter Jackson wrote:
well thats it Ive come to the conclusion that its a driver/lib issue. From what I can see mdbtools lib only reads and only does basic select.
(eg Select * from table where col =thistext But not tex* % or date. Also looks like the project has died (think the last release was 2004 or so.) Thought I would give odbtp ago but cant get that to make. aargghh I give up.
Bastien Koert wrote:On Sat, Jul 5, 2008 at 11:04 AM, Bastien Koert <phpster@gmail.com> wrote:On Sat, Jul 5, 2008 at 6:51 AM, Peter Jackson <tasmaniac@iprimus.com.au> wrote:$conn=odbc_connect("Database","",""); works $a = "abcd"; (this value exists in db) $stat = "Select * FROM " . '"Table Name"'; $qry = odbc_exec($conn,$stat); $res = odbc_result_all($qry) or die("Error: "); The above works as I expect it to.(Returns 70 rows) If I now want to add a where clause $stat = "SELECT * FROM " . '"Table Name"' . " Where " . '"Column Name" = " . $a; (This works) Now the place I fall into the abyss. if I change WHERE clause in $stat to " WHERE " . '"Column Name"' LIKE abc* (or other variations like abc% "abc%" "abc*" 'abc%' 'abc*') All I end up with is a blank page or Warning odbc_result_all No tuples available at this result index. Also I'm having trouble working out how to use a date in the WHERE clause. I've tried #yy-mm-dd# yy-mm-dd* dd/mm/yy etc etc (oh and yy/mm/dd 00:00:00 etc I realize this is probably more odbc/sql related but after a lot of goggling and reading I havent found the answer (about 5 days so far)Unfortunately thats the first thing I thought of. I've tried every variation of quote I could think of. Can anyone tell me how to log what the odbc connection is actually sending/receiving? (as opposed to just echoing the sql statement I 'think' its sending.sorry, missed the access dates... try mm/dd/yyyy as the formatAs the data seems to be text based, you need to quote it WHERE " . '"Column Name"' LIKE 'abc%' -- Bastien Cat, the other other white meat