473,569 Members | 2,542 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('selec t * from table1 where id='.$_GET['id']);
....
// validation take place and now is processed
$_POST["field1"] = $dbr->GetOne('sele ct
AES_ENCRYPT('.t rim($_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 1498

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

Similar topics

4
1880
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 process did not report any errors.
1
5125
by: Gordan | last post by:
mysql> select aes_encrypt('gordan', 'abc'); +------------------------------+ | aes_encrypt('gordan', 'abc') | +------------------------------+ | p§Èb9??_é?0ö?LIÝ | +------------------------------+ I would like to "emulate" that function in PHP. I know that MySQL AES algorithm is RIJNDAEL_128 so I tried the following code <?php
0
2370
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=***** --socket=/path/to/socket --database=mysql --execute=\"INSERT INTO user (Host, User, Password, Select_priv, Insert_priv, Update_priv, Delete_priv,...
0
1044
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, donations.genFund, donations.misFund, donations.benFund, donations.notes, oikos.id, oikos.famLabel FROM donations, oikos WHERE IF(xBatch = '',...
0
3931
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 version of this document can be found at: http://prdownloads.sourceforge.net/souptonuts/README_mysql.txt?download
2
1364
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, standardgame.cutoffdatetime, standardgame.gametype,
0
1928
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 that a few entries when returned using AES_DECRYPT register as NULL. The column in question is of type TINYBLOB, and has a NOT NULL constraint. ...
2
4587
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 decrypt it because the code specifies a Query. But the INSERT is an ADODB insert: $_POST = 83; .... runQuery($db ->GetInsertSQL($rs, $_POST, true));
2
1643
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. The first table is easy to accomplish. The user first and last name, e address, and they set a password - is INSERTED. VALUES pass and the...
0
7700
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7614
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7676
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7974
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
1
2114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1221
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
938
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.