Select Statement MYSQL question usiong a HTML form I m trying to display Customer Information

Select statment being used, works great! but when I qwant to add another field to show on my screen it fails.

Good  ---    $result = mysqli_query($con,"SELECT emailaddress, aes_decrypt(password,'XXXXXXX') as encrypted from biomas.ITCustomerLogin where emailaddress = '$Email'");

Not Good does not work ---  $result = mysqli_query($con,"SELECT Customer, emailaddress, aes_decrypt(password,'XXXXXXX') as encrypted from biomas.ITCustomerLogin where emailaddress = '$Email'");

I am not sure but because the select statment s looking at email address as part of the key to decrypt the account password, i guessing I have some systax that is not correct when selecting more.

I hop ethis makes sense and someone can identfy the small problem?
Scott JohnstonIT Manager Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Walter RitzelSenior Software EngineerCommented:
Can you provide the table structure and the error that is being given?
Scott JohnstonIT Manager Author Commented:
Talble is MYSQL
Divson, Customer, Emailaddress,Password(BLOB),newsletter

 echo "Failed to connect to MySQL: " . mysqli_connect_error();

$Email = mysqli_real_escape_string($con, $_GET['emailaddress']);

$result = mysqli_query($con,"SELECT Customer, emailaddress, aes_decrypt(password,'itpass') as encrypted from biomas.ITCustomerLogin where emailaddress = '$Email'");

echo "<table border='1'>
 <th>Password for Customers who logon to web site</th>

 echo "<table border='1'>
 <th>Email Address</th>
 <th>Logon Password</th>

 while($row = mysqli_fetch_array($result))  (Error from this line?)

   echo "<tr>";
   echo "<td>" . $row['emailaddress'] . "</td>";
   echo "<td>" . $row['encrypted'] . "</td>";
     echo "<td>" . $row['Customer'] . "</td>";
     echo "</tr>";
 echo "</table>";


Open in new window

Walter RitzelSenior Software EngineerCommented:
Are you sure that Customer is really capitalized as that, with first letter a capital C? Because you write Emailaddress with capital E, but in your previous working code, it is a lower e. MYSQL is case sensitive with field names.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Active Protection takes the fight to cryptojacking

While there were several headline-grabbing ransomware attacks during in 2017, another big threat started appearing at the same time that didn’t get the same coverage – illicit cryptomining.

Scott JohnstonIT Manager Author Commented:
Walter can you advise me on adding a :"Back Button"  I've been trying to use History Back Method but ?
Walter RitzelSenior Software EngineerCommented:
Can't you use a link back to the previous page?
Scott JohnstonIT Manager Author Commented:
Of Course,,, works like a top!!!!

Thanmk you
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.