Jump to content

Connecting to a SQLITE database


Phpnewbie23

Recommended Posts

Looking at php.net can i use the sqlite functions with the ODBC functions  this is my code it is suppost to populate a table with Backup_Name.

 

<?php

//  Database connector

$conn=odbc_connect('VembuDSN', '', '');

 

//  Generate querey string

$query="SELECT BACKUP_NAME FROM INCREMENTAL_BACKUP_REPORT";

$res=odbc_exec($conn,$query);

 

// execute query

// return result object

$result=odbc_result($res);

//$conn->query($query); //or die("Error in query");

 

// if rows exist

if ($result->odbc_num_rows() >0) {

//get each row as an array

//print values

echo"<table cellpadding=10 border=1>";

while($row=$result->fetch()) {

echo "<tr>";

echo "<td>".$row[0]."</td>";

echo "<td>".$row[1]."</td>";

echo "<td>".$row[2]."</td>";

}

echo "</table>";

}

?>

 

Cheers

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.