database result and if logic

Schrimpkutter

Новичок
Регистрация
20.10.2014
Сообщения
7
Благодарностей
0
Баллы
1
Hello guys im from germany so my english is not that good :(
I found an thread here for connection c# to mysql. this works fine for me im doing a select and the result will be safed in a variable. my problem, i try to compare the result of mysql with an other variable with the if logic but everytime a bad end.

If looks like this:
"{-Variable.var_url-}"=="{-Variable.var_db_result-}"
First Variable is the url of a site and the second is the result of mysql.
If i make a new variable and put the content from {-Variable.var_db_result-} to it it works.

I hope someone has a tip for me :-)
variables.jpg

This is the Code i found in the forum:
db_connect.jpg
 

Tobbe

Client
Регистрация
01.08.2013
Сообщения
428
Благодарностей
148
Баллы
43
"{-Variable.var_url-}"=="{-Variable.var_db_result-}" should return true/good if the variables are the same.
You sure no of the variables contains some white space? Like a line break, or space. Try to trim them.
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 770
Благодарностей
1 182
Баллы
113
Try to use string escape on both your variables before comparing. Data ==> Word processing ==> String escape
 
  • Спасибо
Реакции: rostonix

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 707
Баллы
113

Schrimpkutter

Новичок
Регистрация
20.10.2014
Сообщения
7
Благодарностей
0
Баллы
1
You guys are right after the String escape it looks like this: 96WTM9ZX9C/\r\n so now i need to use regex to delete the unnecessary character ?
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 707
Баллы
113
semms like you have invisible line break at the end.
use word processing - trim to variable
 
  • Спасибо
Реакции: Schrimpkutter

Schrimpkutter

Новичок
Регистрация
20.10.2014
Сообщения
7
Благодарностей
0
Баллы
1
Thanks it works now.
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)