Posted 07 August 2014 - 07:41 PM
EDIT: This must've been some kindof typo, since everything works after a little rewrite. Thanks for reading.
Solved
Hello
I've lately ran into a problem, which i just cant figure out how to fix properly.
What i want to happen is sending 4 strings, and 1 serialized table, to get set into a database row
However i've got a syntax error from the webpage saying:;
Sending code:
If nothing seems wrong with the code, then it may be the Mysql Query
Thanks in Advance
Best regards Mikk809h
Solved
Hello
I've lately ran into a problem, which i just cant figure out how to fix properly.
What i want to happen is sending 4 strings, and 1 serialized table, to get set into a database row
However i've got a syntax error from the webpage saying:;
You have an error in your SQL syntax: check the manual that corresponds to your MySQL server version for the right syntax to use near '"Hello"},'3')' at line 1
i have no idea what that "3" is meaning, and i just cant remember how to post a string( which is a serialized table ) into the post data.Sending code:
Spoiler
local saltString = '{"Hello"}'
-- "dat" is a table defined earlier with data from a serialized file
--print( saltString )
http.request(
Settings.ServerVerification .. '?' ..
'VER=' .. ***** .. '&' .. -- *** is verification
'TYPE=reg' .. '&' .. -- type reg is "Register"
'Password=' .. dat[ 'Password' ] .. '&' ..
'Salt=' .. saltString .. '&' ..
'Tries=' .. dat[ 'TriesLeft' ]
)
If nothing seems wrong with the code, then it may be the Mysql Query
$newResult = mysql_query("INSERT INTO $tablename (ComputerID, Password, Salt, Tries) VALUES ($comID, '$datPass', $datSalt, '$datTries')", $dbhandle) or die( mysql_error() );
Thanks in Advance
Best regards Mikk809h
Edited on 07 August 2014 - 09:18 PM