Check the result of prepare and execute. I bet you're getting a syntax error, and the fetch is giving you that error. More specifically, you're not escaping $X_Y and $check, and you're not quoting $check. I prefer replaceable parameters instead of building a SQL string dynamically where possible. If you use replaceable parameters, you don't have to quote or escape, and you're safe from SQL injection attacks.
$sql= "SELECT C.mast1, C.mast2 FROM MASTER WHERE C.mast1=? AND C.mast2 +=?"; $sth = $dbh->prepare($sql) or die(...); $sth->execute($check, $X_Y) or die(...); ...
In reply to Re: Value to Sub
by ikegami
in thread Value to Sub
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |