# LuaSql-Sqlite3 with html using uhttpd server

**URL:** <https://forum.openwrt.org/t/luasql-sqlite3-with-html-using-uhttpd-server/129333>\
**Category:** For Developers\
**Created:** [June 7, 2022, 9:24am UTC](https://forum.openwrt.org/t/luasql-sqlite3-with-html-using-uhttpd-server/129333 "2022-06-07T09:24:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sonet.bd](https://forum.openwrt.org/letter_avatar/sonet.bd/32/5_5575768a8748004e209b776fc1b2916d.png) [@Sonet.bd](https://forum.openwrt.org/u/Sonet.bd)\
**Post date:** [June 7, 2022, 9:24am UTC](https://forum.openwrt.org/t/luasql-sqlite3-with-html-using-uhttpd-server/129333/1 "2022-06-07T09:24:00Z")

</div>

How can I connect my database using lua and display data to server in a html.  
I followed below tutorials and individually both are working .  
I can connect to database and can fetch data and display them to serial.

> **[Lua - Database Access](https://www.tutorialspoint.com/lua/lua_database_access.htm)**
>
> Lua Database Access - For simple data operations, we may use files, but, sometimes, these file operations may not be efficient, scalable, and powerful. For this purpose, we may often switch to using databases. LuaSQL is a simple interface from Lua to...

I can also display html template in browser via uhttpd server.

> [@Example of web interface using uHTTPd and Lua](https://forum.openwrt.org/t/example-of-web-interface-using-uhttpd-and-lua/67181):
>
> I would like to create a web interface for controlling my home automation, using uHTTPd and Lua, without interfering with LuCI operation. After reading a lot of documentation and after several trial and error, I was able to write a skeleton, solving the main difficulties. As I don't encounter any complete example, I would like to share this one, with a double goal: help beginners like me (so with a very basic level :-), have the opinion and possible corrections or suggestions of the experts. …

but how can i merge them to fetch data from database and show them to the html.
