yuyen wrote: > HI, JC > I use php_do_sqlite with PHP 5.1.4 and Sqlite 3.2.8 on Windows XP. The > following is my coding: > > <?php > try{ > $dsn = 'sqlite:counter/cntdata.sq3'; > $myConn = new PDO($dsn); > $myConn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); > > $myPre = $myConn->prepare('update test_item set balqty = 100'); > $myPre->execute(); > }catch (PDOException $e){ > die('execute err: '.$e->getMessage()); > } > print('done!'); > ?> > ----- > And the error is: > execute err: SQLSTATE[HY000]: General error: 1 SQL logic error or > missing database > > ----- > Would you please have a look and give me an advise. Thank you! > > > Jack >
Not having a windows box at hand, I can only guess things :) But, if I remember (and sounds like this in PDO code) dns is passed as is, so for windows, your dsn should be: $dsn = 'sqlite:counter\\cntdata.sq3'; or, if you want a really portable way: $dsn = 'sqlite:counter' . DIRECTORY_SEPARATOR . 'cntdata.sq3'; JC