Jump to content

sqlite help


sasori

Recommended Posts

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);




?>

Link to comment
https://forums.phpfreaks.com/topic/117919-sqlite-help/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/117919-sqlite-help/#findComment-606616
Share on other sites

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

 

Link to comment
https://forums.phpfreaks.com/topic/117919-sqlite-help/#findComment-606659
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/117919-sqlite-help/#findComment-606669
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/117919-sqlite-help/#findComment-607220
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/117919-sqlite-help/#findComment-607429
Share on other sites

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" ?

Link to comment
https://forums.phpfreaks.com/topic/117919-sqlite-help/#findComment-607461
Share on other sites

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?

Link to comment
https://forums.phpfreaks.com/topic/117919-sqlite-help/#findComment-607496
Share on other sites

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?

Link to comment
https://forums.phpfreaks.com/topic/117919-sqlite-help/#findComment-607521
Share on other sites

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).

Link to comment
https://forums.phpfreaks.com/topic/117919-sqlite-help/#findComment-607533
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/117919-sqlite-help/#findComment-607538
Share on other sites

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.