Hello, I've been trying to debug this script of mine, and I finally got AES_DECRYPT to work after using the SQL database for a little help in putting together the mysql_query. Those little buggers are always so confusing. Anyways, I finally got it to work, and in the actual SQL query, it produced the correct information. When I converted it to PHP and tried out the script, however, I got this: Resource ID#5 I'm absolutely baffled. Here's the code: mysql_connect("localhost","root"); mysql_select_db("edit_db"); $art=$_POST['title']; $result=mysql_query("SELECT * FROM articles"); $row=mysql_fetch_array($result); $sql = mysql_query("SELECT aes_decrypt(`Text`, \"lolsecret\") FROM articles WHERE `Title` = \"$art\""); if ($row['Title'] == $art) { echo "$row[Title]<hr><br/>".$sql."<br/><a href='view.php'>Return to viewing</a> <a href='edit.php'>Edit this page</a>"; } else { echo "No matches found."; header("refresh:4;http://localhost/Tests/edit/view.php"); } PHP: I tested it by making an "article" named "Day" with the content "A day is a thing." What this thing output was: Day<hr/><br/> Resource id #5<hr/><br/> (Return to viewing) (Edit this page) I was wondering why it was doing this when it correctly displayed the information while I ran the query in the database. If anyone can help me out, I'd greatly appreciate it!
Not sure but you may need to use alias in SELECT: $sql = mysql_query("SELECT aes_decrypt(`Text`, \"lolsecret\") AS mytext FROM articles WHERE `Title` = \"$art\"");