Welcome Guest, Not a member yet? Register   Sign In
PDO php class SQLite problem
#1

[eluser]René Tuin[/eluser]
Hi all,

I have the following problem.
I have a update functie which I build in php, only I get the following error.

'SQLSTATE[HY000] [14] unable to open database file'

Here is my code:

Code:
<?php
try {
    /*** connect to SQLite database ***/
    $db = new PDO('sqlite:http://localhost/IRS/CMS_Codeignitor/website.sqlite');
    $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
      $error = $db->errorInfo();
      
      if($error[0] != "") {
          print "<p>DATABASE CONNECTION ERROR:</p>";
          print_r($error);
      }

    foreach ($_GET['listItem'] as $position => $item) {
                        
        $sql = "UPDATE Pages SET Volgorde = $position WHERE id_Pages = $item";
        $db->exec($sql);
    }
    
    
}
catch(PDOException $e)
{
    echo $e->getMessage();
    
}
?&gt;

I can build this update functie with the framework because I call this functie with AJAX HTTP Request.
So I must build it with php.

So i hope someone can help me.


Messages In This Thread
PDO php class SQLite problem - by El Forum - 06-02-2009, 01:20 AM
PDO php class SQLite problem - by El Forum - 06-02-2009, 01:37 AM
PDO php class SQLite problem - by El Forum - 06-02-2009, 01:46 AM
PDO php class SQLite problem - by El Forum - 06-10-2009, 03:04 AM
PDO php class SQLite problem - by El Forum - 06-10-2009, 04:00 AM
PDO php class SQLite problem - by El Forum - 06-22-2009, 05:24 AM
PDO php class SQLite problem - by El Forum - 06-22-2009, 05:29 AM
PDO php class SQLite problem - by El Forum - 06-22-2009, 05:52 AM
PDO php class SQLite problem - by El Forum - 06-22-2009, 06:54 AM
PDO php class SQLite problem - by El Forum - 06-22-2009, 07:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB