mcrypt blob upload problem to MySQL



Greetings

I have a script in which I am collecting sensitive information via a
form (METHOD=POST) and encrypting the posted variable (format = BLOB)
using mcrypt, then saving it in a MySql table. Using my test
script,everything works fine. Using my production scrypt, everything
works fine for data posted with fewer than 8 characters. If I try to
upload data longer than 8 characters, I get this error message:

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 'ióU¹
??C!Ê?B', '01', '2004', NULL, '150')' at line 1

The characters ióU¹??C!Ê?B' after "near" are the encrypted characters.

There does not seem to be any difference between the test and production
scrypts.

Here is the syntax I am using for saving the record:

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "myTable"))
{
$insertSQL = sprintf("INSERT INTO myTable (`Date`, LastName,
FirstName, EcryptedBlob) VALUES (%s, %s, %s, %s)",
GetSQLValueString($_POST['Date'], "text"),
GetSQLValueString($_POST['Lastname'], "text"),
GetSQLValueString($_POST['Firstname'], "text"),
GetSQLValueString($encrypted,"text"));

php v. 5.0.5
MySql v. 4.1.9


Any help would be appreciated.

.



Relevant Pages

  • Inserting an Email Address fails.
    ... I'm trying to insert an email address into a mysql database and it seems ... neither of which works and both return pretty much the same error message. ... for the right syntax to use near 'From = 'KHamilton@Hunter.COM', ... I put MsgID first and the email address last it still dies on the mail ...
    (perl.dbi.users)
  • Re: Inserting an Email Address fails.
    ... > neither of which works and both return pretty much the same error message. ... > syntax. ... Check the manual that corresponds to your MySQL server version ... > I put MsgID first and the email address last it still dies on the mail ...
    (perl.dbi.users)
  • Re: SHOW TABLE STATUS
    ... I am using MySQL - 4.1.22 when i use the following sql query ... 1064 Error Message: You have an error in your SQL syntax; ... SHOW TABLE query for version 4.1.22 and also is there a difference ...
    (comp.lang.php)
  • RE: Inserting an Email Address fails.
    ... have you tried to execute the SQL using mysql client? ... don't see typical syntax error but when $ usually get that output i try to work out my sql syntax first then try to integrate with script later, ... I'm trying to insert an email address into a mysql database and it seems ... neither of which works and both return pretty much the same error message. ...
    (perl.dbi.users)
  • Re: mcrypt blob upload problem to MySQL
    ... form and encrypting the posted variable using mcrypt, then saving it in a MySql table. ... corresponds to your MySQL server version for the right syntax to use ... Here is the syntax I am using for saving the record: ...
    (comp.lang.php)