Phpnewbie23 Posted December 4, 2008 Share Posted December 4, 2008 Is there any other way to connect to a sqlite database other than ODBC. Cheers Quote Link to comment https://forums.phpfreaks.com/topic/135506-connecting-to-a-sqlite-database/ Share on other sites More sharing options...
MadTechie Posted December 4, 2008 Share Posted December 4, 2008 ODBC if its no another PC but if its local then just use the file path.. Quote Link to comment https://forums.phpfreaks.com/topic/135506-connecting-to-a-sqlite-database/#findComment-705962 Share on other sites More sharing options...
.josh Posted December 4, 2008 Share Posted December 4, 2008 http://www.google.com/search?hl=en&q=php+connect+to+sqlite+database&btnG=Google+Search Quote Link to comment https://forums.phpfreaks.com/topic/135506-connecting-to-a-sqlite-database/#findComment-705963 Share on other sites More sharing options...
Phpnewbie23 Posted December 4, 2008 Author Share Posted December 4, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/135506-connecting-to-a-sqlite-database/#findComment-705981 Share on other sites More sharing options...
Mchl Posted December 4, 2008 Share Posted December 4, 2008 There's sqlite extension enabled by default since PHP5... Quote Link to comment https://forums.phpfreaks.com/topic/135506-connecting-to-a-sqlite-database/#findComment-705986 Share on other sites More sharing options...
fj1200 Posted December 4, 2008 Share Posted December 4, 2008 Go with the sqlite(). It's far easier and probably faster and it's native to php. Quote Link to comment https://forums.phpfreaks.com/topic/135506-connecting-to-a-sqlite-database/#findComment-706002 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.