Jump to content

AES_DECRYPT question


cbastian

Recommended Posts

OK, first off, I'm new to PHP and MySQL. So please forgive me if this is a really basic question.I'm working with a database created by someone else, before I started here. I've got a table with about 6000 records, all of which have one column that is encrypted (the social security number). I'm trying to grab certain records out of the table, and create PDF files with them. No problem there. but when I try to decrypt the ssn's to use them too, it's not working. Here's what I'm trying to do:

$sql = "SELECT * FROM admissions.applications3 WHERE pdfsend = 5";$res = mysqli_query($mysqli, $sql);// That works fine, and grabs all the needed records.$sql1 = "SELECT AES_DECRYPT('ssn','encryption key') AS newssn FROM ssn";// then later, after opening the pdf file$ssn = $newArray['newssn'];//this is to put the data for each particular record into a variable to write to the pdf file.

I'm not receiving any errors, it's just not showing anything when I write the pdf. In the above code the database is admissions, the table is applications3, and the particular field is ssn. I've tried to find tutorials on this, but I can't seem to find anything that makes sense to my limited knowledge of PHP and MySQL.Any help with this would be greatly appreciated.Thanks a lot!-Charles...

Link to comment
Share on other sites

Print out the array to see what's in it.print_r($newArray);
I've tried that, and it comes back with nothing. I'm guessing that there is something wrong with my SQL statement, and it's not putting any data in the array.Thanks,Charles...
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...