32 password = luaL_checkstring(L, 3); |
32 password = luaL_checkstring(L, 3); |
33 case 2: |
33 case 2: |
34 if (lua_isnil(L, 2) == 0) |
34 if (lua_isnil(L, 2) == 0) |
35 user = luaL_checkstring(L, 2); |
35 user = luaL_checkstring(L, 2); |
36 case 1: |
36 case 1: |
37 if (lua_isnil(L, 1) == 0) |
37 /* |
38 db = luaL_checkstring(L, 1); |
38 * db is the only mandatory parameter |
|
39 */ |
|
40 db = luaL_checkstring(L, 1); |
39 } |
41 } |
40 |
42 |
41 conn = (connection_t *)lua_newuserdata(L, sizeof(connection_t)); |
43 conn = (connection_t *)lua_newuserdata(L, sizeof(connection_t)); |
42 |
44 |
43 conn->mysql = mysql_init(NULL); |
45 conn->mysql = mysql_init(NULL); |