<highlight language="lua">
function handler(r)
-- Acquire a database handle
<highlight language="lua">
function handler(r)
-- Acquire a database handle
- local database, err = r:dbacquire("mysql", "server=localhost&user=root&database=mydb")
+ local database, err = r:dbacquire("mysql", "server=localhost,user=root,dbname=mydb")
if not err then
-- Select some information from it
local results, err = database:select(r, "SELECT `name`, `age` FROM `people` WHERE 1")
if not err then
-- Select some information from it
local results, err = database:select(r, "SELECT `name`, `age` FROM `people` WHERE 1")