473,503 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

trouble MySQL AES_ENCRYPT() using PHP for SQL statement

I want to add a binary element (AES_ENCRYPT()) to a $_POST array. I need to
make it binary because it is going into a BLOB field.

$results = $dbr->Execute('select * from table1 where id='.$_GET['id']);
....
// validation take place and now is processed
$_POST["field1"] = $dbr->GetOne('select
AES_ENCRYPT('.trim($_POST['field1']).', \'salt*&)#\')');
// there are other $_POST fields that are in cluded in the next line
// GetInsertSQL is a function that eventually calls $dbr->Execute()
$dbr ->GetInsertSQL($results, $_POST, true);
It decrypts most records (field1) but not all. After researching it, I think
the problem lies in how I am adding the encrypted field.

I think I need to make the $_POST["field1"] binary, somehow.

If so, how do I do that?

Any other ideas?

(the $dbr is an ADODB element.)
Aug 24 '07 #1
0 1488

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
1873
by: frankgerlach | last post by:
I am experiencing problems when installing PHP5/MYSQL. I did ./configure --with-mysql=/usr/local/mysql --disable-libxml --with-zlib-dir=/home/frank/zlib-1.2.2 make make install The build...
1
5109
by: Gordan | last post by:
mysql> select aes_encrypt('gordan', 'abc'); +------------------------------+ | aes_encrypt('gordan', 'abc') | +------------------------------+ | p§Èb9??_é?0ö?LIÝ |...
0
2364
by: Michael Iatauro | last post by:
I've been having a little trouble creating users cross-platform. I have a little script that works just fine on Solaris 8 using this command: eval "/path/to/mysql --user=root --password=*****...
0
1035
by: David McCowan | last post by:
Have a problem with this query, when xBatch is empty or at least seems to be empty. Using DWMX, MySQL, and PHP SELECT donations.id, donations.batch, donations.oikos_id, donations.giftDate,...
0
3925
by: Mike Chirico | last post by:
Interesting Things to Know about MySQL Mike Chirico (mchirico@users.sourceforge.net) Copyright (GPU Free Documentation License) 2004 Last Updated: Mon Jun 7 10:37:28 EDT 2004 The latest...
2
1357
by: bob | last post by:
Could someone help me get the following SQL statement working? SELECT standardgame.gamename, standardgame.rowteamname, standardgame.colteamname, standardgame.dollarvalue, standardgame.gameid,...
0
1926
by: Marcus | last post by:
Hello, I have been storing passwords in my database via AES_ENCRYPT and using AES_DECRYPT if I need to retrieve them in readable form. For the most part everything works fine, but I noticed...
2
4580
by: Paul | last post by:
I encrypted a database field using MySQL AES_ENCRYPT() from a mysql command prompt. But I need to encrypt and decrypt at will in the php code as records are added and viewed. I can easily...
2
1641
Odisey
by: Odisey | last post by:
OK -I can do this in PhpMyAdmin (hard coded) - so its not a DB problem. I am just getting started - thank you for the help. I am creating a page to INSERT user information into two tables. ...
0
7203
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7281
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6993
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7462
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5579
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
737
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
383
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.