Jump to content

ethershade

Members
  • Posts

    1
  • Joined

  • Last visited

Details

  • Gang
    Pirate

ethershade's Achievements

I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody.

I ordered some spaghetti with marinara sauce and I got egg noodles and ketchup. I'm an average nobody. (2/54)

0

Reputation

  1. Alright, For sheer arguments sake instead of getting into reasoning, me and a friend have decided to use the MTA-MySQL Module as opposed to the SQL database. My first question is: Since it appears that there are two MySQL plugins to choose from, is the version by Alberto Alonso better then the supposed actual one (at least I think there is an actual one by the MTA developers). Second question: How do we extract data from the result? As opposed to SA:MP, MTA's mysql module is a lot more advanced, though confusing at times, to utilize. local accresult = mysql_query(masterMysqlHandle, "SELECT id FROM account WHERE [u]user[/u]='"..username.."'") if (mysql_num_rows(accresult) == 1) then outputChatBox("(ACCOUNT) Your username is already registered on the server.", playerid) mysql_free_result ( accresult ) return end mysql_free_result ( accresult ) For some reason, that returns an error 'bad argument #1 to 'mysql_num_rows' (LuaBook.mysqlResult expected, got nil)' Third question: Can we free the result immediately after we do the query, or do we free it after were done with what we need. EX local accresult = mysql_query(masterMysqlHandle, "SELECT id FROM account WHERE user='"..username.."'") mysql_free_result ( accresult ) if (mysql_num_rows(accresult) == 1) then outputChatBox("(ACCOUNT) Your username is already registered on the server.", playerid) return end Request: If possible, can someone post a few lines of code to demonstrate the proper way of retrieving data using the MySQL Module [uPDATE] I found the problem, I was using 'name' as a field title thing, I forgot that you can't, I renamed the field and updated the script. Tried it and it works now. I'm such an idiot, I remember SAMP crashing from this same problem. The free result thing still needs to be answered though, if someone is willing.
×
×
  • Create New...