Skip to content

Instantly share code, notes, and snippets.

@omo
Created September 19, 2008 14:58
Show Gist options
  • Save omo/11600 to your computer and use it in GitHub Desktop.
Save omo/11600 to your computer and use it in GitHub Desktop.
/* send_query */
static VALUE send_query(VALUE obj, VALUE sql)
{
MYSQL* m = GetHandler(obj);
Check_Type(sql, T_STRING);
if (GetMysqlStruct(obj)->connection == Qfalse) {
rb_raise(eMysql, "query: not connected");
}
if (mysql_send_query(m, RSTRING_PTR(sql), RSTRING_LEN(sql)) != 0)
mysql_raise(m);
return Qnil;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment