..:D&G:.. Posted April 23, 2016 Share Posted April 23, 2016 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
Anubhav Posted April 24, 2016 Share Posted April 24, 2016 You forgot .. after getPlayerIP. Link to comment
Moderators IIYAMA Posted April 29, 2016 Moderators Share Posted April 29, 2016 [quote name=..&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
..:D&G:.. Posted April 30, 2016 Author Share Posted April 30, 2016 Um... I've fixed it long time ago, but ok... Link to comment
Moderators IIYAMA Posted April 30, 2016 Moderators Share Posted April 30, 2016 Great, Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now