From 25fdac818c894603235b6524d0ba7da8ef498de9 Mon Sep 17 00:00:00 2001 From: tomas Date: Wed, 25 Jan 2006 20:24:35 +0000 Subject: [PATCH] Adding method `numrows'. --- src/ls_mysql.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/ls_mysql.c b/src/ls_mysql.c index e15df47..1928930 100644 --- a/src/ls_mysql.c +++ b/src/ls_mysql.c @@ -2,7 +2,7 @@ ** LuaSQL, MySQL driver ** Authors: Eduardo Quintao ** See Copyright Notice in license.html -** $Id: ls_mysql.c,v 1.19 2004/12/14 19:27:05 eduquintao Exp $ +** $Id: ls_mysql.c,v 1.20 2006/01/25 20:24:35 tomas Exp $ */ #include @@ -309,6 +309,15 @@ static int cur_getcoltypes (lua_State *L) { } +/* +** Push the number of rows. +*/ +static int cur_numrows (lua_State *L) { + lua_pushnumber (L, (lua_Number)mysql_num_rows (getcursor(L)->my_res)); + return 1; +} + + /* ** Create a new Cursor object and push it on top of the stack. */