Jump to content

[HELP] Attempt to call a string value


..:D&G:..

Recommended Posts

local accID = getAccountID(username) or 0 
            dbExec(connection, "INSERT INTO `userdata` SET `userid`='" .. accID .. "', `online`='0', `username`='" .. username .. "', `usergroupid`='0', `registered`='1', `admin`='0', `joined`='" .. getTheTime() .. "', `team`='nil', `serial`='"..getPlayerSerial(player).."', `ip`='"..getPlayerIP(player)"', `lastvisit`='"..getTheTime().."', `cc`='EN', `playtime`='0', `settings`='0', `stunts`='0', `tuning`='0', `shooterlevel`='0', `clan`='0', `arena`='0', `language`='Enlgish', `autosave`='1', `special`='0', `nickname`='"..getPlayerName(player).."', `dmRak`='0', `raceRank`='0', `ddRank`='0', `trialsRank`='0', `runRank`='0'") 

Any ideas why I keep getting "Attempt to call a string value" here...?

Thanks.

Link to comment
  • Moderators

[quote name=..:D&G:..]

local accID = getAccountID(username) or 0 
            dbExec(connection, "INSERT INTO `userdata` SET `userid`='" .. accID .. "', `online`='0', `username`='" .. username .. "', `usergroupid`='0', `registered`='1', `admin`='0', `joined`='" .. getTheTime() .. "', `team`='nil', `serial`='"..getPlayerSerial(player).."', `ip`='"..getPlayerIP(player)"', `lastvisit`='"..getTheTime().."', `cc`='EN', `playtime`='0', `settings`='0', `stunts`='0', `tuning`='0', `shooterlevel`='0', `clan`='0', `arena`='0', `language`='Enlgish', `autosave`='1', `special`='0', `nickname`='"..getPlayerName(player).."', `dmRak`='0', `raceRank`='0', `ddRank`='0', `trialsRank`='0', `runRank`='0'") 

Any ideas why I keep getting "Attempt to call a string value" here...?

Thanks.

And the data must be added as parameters, not as the query string.

dbExec( connection, [color=#FF0000]"INSERT INTO table_name VALUES (?,?,?)"[/color][color=#0000FF][b],[/b][/color] [color=#008000]"aaa"[/color][color=#0000FF][b],[/b][/color] [color=#008000]"bbb"[/color][color=#0000FF][b],[/b][/color] [color=#008000]10[/color] ) 

query string

parameters/data

separate by comma

https://wiki.multitheftauto.com/wiki/DbExec

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...