Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8590063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:12:27+00:00 2026-06-11T23:12:27+00:00

I am trying to do a basic mysql update using AES_ENCRYPT in PHP but

  • 0

I am trying to do a basic mysql update using AES_ENCRYPT in PHP but I cant get it work.
Here is my full code:

$key = "bac09c63f34c9845c707228b20cac5e0";
$query = " SELECT id, aes_decrypt(Column1, '$key') AS Column1, aes_decrypt(Column2, '$key') AS Column2 FROM parent WHERE Request = '{$Request}' ORDER BY ID ASC;";
$resultSet = mysql_query($query, $DB);
while ($row = mysql_fetch_array($resultSet)) {
    $id = $row['ID'];
    $rows[] = $row["Request"];
    $Column1 = $row["Column1"];
    $Column2 = $row["Column2"];

$SQL = "UPDATE parent SET Column1 = AES_ENCRYPT('$Column1','$key'), Column2 = AES_ENCRYPT('$Column2','$key') WHERE Parent_ID = '$id';";
        if (!mysql_query($SQL, $DB))
            die("Query Failed $SQL");
    }

PHP error log is fine, there is no error. Only this:

Query Failed 
UPDATE parent SET Column1 = AES_ENCRYPT('722225374673255299521908919676768...etc','bac09c63f34c9845c707228b20cac5e0')
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T23:12:28+00:00Added an answer on June 11, 2026 at 11:12 pm

    Use this query –

    UPDATE parent SET Column1 = AES_ENCRYPT('$Column1','$key'), Column2 = AES_ENCRYPT('$Column2','$key') WHERE Parent_ID = $id;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to do a basic mysql update but using AES_ENCRYPT - can
I'm trying to get a product search to work properly in MySQL 5.0.88. Basic
I'm trying the basic jMonkey but I get this exception jun 27, 2012 9:25:08
I'm trying to implement some basic entities using Hibernate/JPA. Initially the code was deployed
I am trying to implement a basic full-text search with MySQL. I wrote this
I am trying to get a full text search on a mysql database. The
I am trying to connect my PHP code to MySQL safely with the following
I am working with Moodle 2.2.1 but have a basic php-mysql problem. I am
I have been trying to get this code to update, and it just will
Im trying to connect MySql from VB.NET in visual basic 2010. I wanted to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.