Access sqlite database : sqlite database « MySQL Database « PHP






Access sqlite database

 
$dbconn = sqlite_open('phpdb');

    if ($dbconn) {
            sqlite_query($dbconn, "CREATE TABLE animal(Name VARCHAR(255), MaxAge INT);");
            sqlite_query($dbconn, "INSERT INTO animal VALUES ('A', 15)");
            $result = sqlite_query($dbconn, "SELECT Name FROM animal");
            var_dump(sqlite_fetch_array($result, SQLITE_ASSOC));
    } else {
            print "Connection to database failed!\n";
    }
  
  








Related examples in the same category

1.Copying Resultsets into an Array Manually
2.Creating an SQLite database
3.SQLite Error Constants