Click here to Skip to main content
15,612,987 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to create an online shopping application using HTML. To access the products and its details, I need to access SQLite database. Is it possible to directly access it from HTML?
Updated 15-Jun-20 0:29am

Share this answer
Karen 9664312 6-Feb-13 5:40am    
Yes I tried that. But I'm getting an error "Invalid character constant" for mydb in the below line
var db = openDatabase('mydb', '1.0', 'my first database', 2 * 1024 * 1024);
Try this code. It accesses a table called SELLERS from a database auntiesinc.



$db = new MyDB();
if(!$db) {
echo $db->lastErrorMsg();
else {
echo "Opened database successfully \n" ;

$sql =<<<eof
select="" *="" from="" sellers;


echo "ID = " . $row['ID'] . "\n";
echo "Seller Name = " . $row['SELLERNAME']. " " . $row['SELLERSNAME'];

echo "Operation done successfully\n";

Share this answer
Richard Deeming 15-Jun-20 15:42pm    
Your unexplained, unformatted, and incomplete code-dump is completely irrelevant to the question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900