sasori Posted August 3, 2008 Share Posted August 3, 2008 the error says Warning: sqlite_query() [function.sqlite-query]: no such table: Product in C:\wamp\www\test2\index2.php on line 76 can't connect when there is a Product table existing in my testdb database kindly help me configure what's going on with that error please? here's my code <?php $db = sqlite_open("testdb"); $sql = "SELECT * FROM Product"; $result = sqlite_query($db,$sql) or die ("can't connect"); $row = sqlite_fetch_array($resut); while($row = sqlite_fetch_array($result)) { foreach($row as $value) { echo "$value<br/>"; } } sqlite_close($db); ?> Quote Link to comment https://forums.phpfreaks.com/topic/117919-sqlite-help/ Share on other sites More sharing options...
JasonLewis Posted August 3, 2008 Share Posted August 3, 2008 Try replacing this: $db = sqlite_open("testdb"); With this: $db = sqlite_open("testdb", 0666, $error); echo $error."<br />"; I've never use SQLite before so I'm just looking at the manual. Quote Link to comment https://forums.phpfreaks.com/topic/117919-sqlite-help/#findComment-606568 Share on other sites More sharing options...
sasori Posted August 3, 2008 Author Share Posted August 3, 2008 Try replacing this: $db = sqlite_open("testdb"); With this: $db = sqlite_open("testdb", 0666, $error); echo $error."<br />"; I've never use SQLite before so I'm just looking at the manual. same error..it just added a space above the error message because of the <br> tag Quote Link to comment https://forums.phpfreaks.com/topic/117919-sqlite-help/#findComment-606570 Share on other sites More sharing options...
wildteen88 Posted August 3, 2008 Share Posted August 3, 2008 the error says Warning: sqlite_query() [function.sqlite-query]: no such table: Product in C:\wamp\www\test2\index2.php on line 76 can't connect when there is a Product table existing in my testdb database kindly help me configure what's going on with that error please? How did you create the table? Make sure your have spelt product correctly. Quote Link to comment https://forums.phpfreaks.com/topic/117919-sqlite-help/#findComment-606616 Share on other sites More sharing options...
sasori Posted August 3, 2008 Author Share Posted August 3, 2008 How did you create the table? Make sure your have spelt product correctly. first i made the testdb using this code $db = sqlite_open(testdb); it generates itself because the file doesn't exist then i made the table Product and the 2 fields named Firstname, Lastname using the sqlite manager Quote Link to comment https://forums.phpfreaks.com/topic/117919-sqlite-help/#findComment-606659 Share on other sites More sharing options...
wildteen88 Posted August 3, 2008 Share Posted August 3, 2008 When using SQLite in PHP make sure the library versions match between sqlite manager and PHP. The Sqlite library built-in to PHP is version 2.8.x (veryfy this by running phpinfo and looking for the SQLite subsection). If sqlite manager is using a newer version of the library, then PHP wont be able to read the database file correctly Quote Link to comment https://forums.phpfreaks.com/topic/117919-sqlite-help/#findComment-606669 Share on other sites More sharing options...
sasori Posted August 4, 2008 Author Share Posted August 4, 2008 i think ill just skip this sqlite lesson.. this stuff isn't used that much in our real world businesses right? Quote Link to comment https://forums.phpfreaks.com/topic/117919-sqlite-help/#findComment-607040 Share on other sites More sharing options...
trq Posted August 4, 2008 Share Posted August 4, 2008 Depends, I use sqlite more often than mysql these days. For small to medium sites its quicker, easier to setup and easier to maintain. Quote Link to comment https://forums.phpfreaks.com/topic/117919-sqlite-help/#findComment-607090 Share on other sites More sharing options...
sasori Posted August 4, 2008 Author Share Posted August 4, 2008 Depends, I use sqlite more often than mysql these days. For small to medium sites its quicker, easier to setup and easier to maintain. am confuse, how could that be? since most "free" webhosting services for PHP doesn't have sqlite on the cpanel , i can only see this stuff in my wamp server in localhost as it is a built-in. Quote Link to comment https://forums.phpfreaks.com/topic/117919-sqlite-help/#findComment-607220 Share on other sites More sharing options...
trq Posted August 4, 2008 Share Posted August 4, 2008 The sqlite extension is built into php by default and has been for a long time. Quote Link to comment https://forums.phpfreaks.com/topic/117919-sqlite-help/#findComment-607346 Share on other sites More sharing options...
sasori Posted August 4, 2008 Author Share Posted August 4, 2008 The sqlite extension is built into php by default and has been for a long time. realy?, so how am i gonna use it then if i can't even see it on the cpanel on a live free webhosting account? Quote Link to comment https://forums.phpfreaks.com/topic/117919-sqlite-help/#findComment-607396 Share on other sites More sharing options...
wildteen88 Posted August 4, 2008 Share Posted August 4, 2008 I believe on windows installations you have to enable the sqlite extension within the php.ini, its not enabled by default However on a *nix (most hosts run linux rather than windows) installations sqlite is available if PHP was complied with the --with-sqlite flag, no need to enable sqlite within php.ini To see if sqlite is available run phpinfo() and look for an sqlite sub heading. Quote Link to comment https://forums.phpfreaks.com/topic/117919-sqlite-help/#findComment-607429 Share on other sites More sharing options...
sasori Posted August 4, 2008 Author Share Posted August 4, 2008 I believe on windows installations you have to enable the sqlite extension within the php.ini, its not enabled by default However on a *nix (most hosts run linux rather than windows) installations sqlite is available if PHP was complied with the --with-sqlite flag, no need to enable sqlite within php.ini To see if sqlite is available run phpinfo() and look for an sqlite sub heading. cool now i can see that sqlite is enabled on my free hosting account.."but", how am i gonna see the "sqlite manager" ? Quote Link to comment https://forums.phpfreaks.com/topic/117919-sqlite-help/#findComment-607461 Share on other sites More sharing options...
wildteen88 Posted August 4, 2008 Share Posted August 4, 2008 By sqlite manager do you mean the firefox addon or some program installed on your computer? Not sure what you mean. Quote Link to comment https://forums.phpfreaks.com/topic/117919-sqlite-help/#findComment-607494 Share on other sites More sharing options...
sasori Posted August 4, 2008 Author Share Posted August 4, 2008 By sqlite manager do you mean the firefox addon or some program installed on your computer? Not sure what you mean. just like what i've said before, sqlite manager is built-in with my wamp on localhost..but on a live free hosting account cpanel, i don't see any sqlite manager, that's what am asking, on how will you be able to see the sqlite manager on a live free hosting account? Quote Link to comment https://forums.phpfreaks.com/topic/117919-sqlite-help/#findComment-607496 Share on other sites More sharing options...
wildteen88 Posted August 4, 2008 Share Posted August 4, 2008 As the database is only single file, I'd just download the .sqll database file to my computer annd open it into sqlite manager to apply whatever changes needs to be done. Once finished I'd reupload the database overwriting the old one. Quote Link to comment https://forums.phpfreaks.com/topic/117919-sqlite-help/#findComment-607519 Share on other sites More sharing options...
sasori Posted August 4, 2008 Author Share Posted August 4, 2008 As the database is only single file, I'd just download the .sqll database file to my computer annd open it into sqlite manager to apply whatever changes needs to be done. Once finished I'd reupload the database overwriting the old one. oh ok..so this means, there is no sqlite manager on live free hosting cpanel accounts at all? Quote Link to comment https://forums.phpfreaks.com/topic/117919-sqlite-help/#findComment-607521 Share on other sites More sharing options...
wildteen88 Posted August 4, 2008 Share Posted August 4, 2008 You'll have to ask your host whether they provide such a facility for managing sqlite databases online, as you're using a free host then I doubt it. To mange an sqlite database online then the application will need to be web base (ie like phpMyAdmin for managing MySQL databases). Quote Link to comment https://forums.phpfreaks.com/topic/117919-sqlite-help/#findComment-607533 Share on other sites More sharing options...
sasori Posted August 4, 2008 Author Share Posted August 4, 2008 You'll have to ask your host whether they provide such a facility for managing sqlite databases online, as you're using a free host then I doubt it. To mange an sqlite database online then the application will need to be web base (ie like phpMyAdmin for managing MySQL databases). oh ok..am not going to close this topic yet.. ill get back to this sqlite thingy. Quote Link to comment https://forums.phpfreaks.com/topic/117919-sqlite-help/#findComment-607538 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.