okay, first your query is breaking paranthesis and ending the mysql query command early
$query = mysql_query
(
'SELECT $_SESSION[user_id] , AES_DECRYPT
(
description,"$_SESSION[cipher_key]"
)
)
FROM example WHERE
(
$_SESSION[user_id]="$_SESSION[user_id]"
');
it should read
$query = mysql_query
(
'SELECT $_SESSION[user_id] , AES_DECRYPT
(
description,"$_SESSION[cipher_key]"
)
FROM example WHERE
(
$_SESSION[user_id]="$_SESSION[user_id]"
)
);
Or inline
$query = mysql_query('SELECT $_SESSION[user_id] , AES_DECRYPT(description,"$_SESSION[cipher_key]") FROM example WHERE($_SESSION[user_id]="$_SESSION[user_id]"));
your first query will produce a fail error
next, can you copy/paste what the actual sql in the end looks like after all the variable substitutions are done
meaning after rewrite $query to leave out the mysql_query
$query = 'SELECT $_SESSION[user_id] , AES_DECRYPT(description,"$_SESSION[cipher_key]") FROM example WHERE($_SESSION[user_id]="$_SESSION[user_id]");
and do echo $query; and give us the result
from what I gathered it shoudl look liek this
lets say $SESSION[user_id]="test"
$query = 'SELECT test , AES_DECRYPT(description,"$_SESSION[cipher_key]") FROM example WHERE(test=test);
so if your database example has a field named test and your looking for rows with value of test in it your query would work, and return the columns test with your AES_DECRYPT value
otherwise, in typical queries, we gather the same information and only change elements such as the where clause, for example using your query
$query = 'SELECT column1 , AES_DECRYPT(description,"'.$SESSION[cipher_key].'") FROM example WHERE column1='.$SESSION[user_id].' ;