Re: SQL question

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
+ (text/plain)
Delete this message
Reply to this message
Author: Herminio Hernandez, Jr.
Date:  
To: Main PLUG discussion list
Subject: Re: SQL question
Using the escape gave another error so I tried `$6$` and the page does not
crash. However, I am not getting a syntax error, see below

<3h4t13f1> DB Error: [1054] Unknown column '$6$' in 'field list'


On Tue, Mar 7, 2017 at 1:52 PM, Herminio Hernandez, Jr. <
> wrote:

> Will check thanks!
>
> On Tue, Mar 7, 2017 at 1:50 PM, Matt Graham <> wrote:
>
>> 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.
>> ---------------------------------------------------
>> PLUG-discuss mailing list -
>> To subscribe, unsubscribe, or to change your mail settings:
>> http://lists.phxlinux.org/mailman/listinfo/plug-discuss
>>
>
>

---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.phxlinux.org/mailman/listinfo/plug-discuss