Hi All,
I have some problem with LinkSQL grammar. In linksql211, I have the following code:
use GT::SQL::Condition;
$link_db = $DB->table ('Links');
$cond = new GT::SQL::Condition;
$cond->add ('Status', '=', '200');
$cond->add('URL', 'NOT LIKE', ['%pdf','%doc','%gif','%jpeg']);
print $cond->sql;This will print "Status = '200' AND lsLinks.URL NOT LIKE 'ARRAY(0x1bf55e4)". Note here the program interprets the [] as an array.The second part of the condition won't work and no url with those file extension will be excluded.If the condition is like this:
This will print ""Status = '200' ". The second part of the condition is totally ignored. I could not figure out what is wrong with my code. Thank you for any clues. Long
I have some problem with LinkSQL grammar. In linksql211, I have the following code:
Code:
use Links qw/$CFG $IN $DB/; use GT::SQL::Condition;
$link_db = $DB->table ('Links');
$cond = new GT::SQL::Condition;
$cond->add ('Status', '=', '200');
$cond->add('URL', 'NOT LIKE', ['%pdf','%doc','%gif','%jpeg']);
print $cond->sql;
Code:
$cond->add ('Status', '=', '200', 'URL', 'NOT LIKE', ['%pdf','%doc','%gif','%jpeg']);