SQL question
Matt Graham
mhgraham at crow202.org
Tue Mar 7 13:50:02 MST 2017
On 2017-03-06 20:38, Herminio Hernandez, Jr. wrote:
> Here is the string I am using 'UPDATE virtual_users SET
> password=ENCRYPT(%p,concat('$6$',substring(sha(rand()),-16))), WHERE
> email=%u LIMIT 1';
>
> However, now roundcube is crashing and I am seeing this error
> Parse error: syntax error, unexpected '$' in
> /var/www/roundcube/roundcubemail-1.2.1/plugins/password/config.inc.php
>
> Not sure what I am missing....
config.inc.php is a PHP file, and variables in PHP have a $ in front of
them. I would guess that you have a line sort of like
$rcmail_config['password_update_query']="UPDATE virtual_users SET
password= ENCRYPT(%p,concat('$6$', substring(sha(rand()),-16))), WHERE
email=%u LIMIT 1";
...which is syntactically invalid because $6 is not a valid variable
name. The $ chars in the SQL need to be escaped with \ . Try replacing
'$6$' with '\$6\$' .
--
Crow202 Blog: http://crow202.org/wordpress
There is no Darkness in Eternity
But only Light too dim for us to see.
More information about the PLUG-discuss
mailing list