compare two fields from 2 tables |
8/5/2008 7:07:10 AM |
PHPRunner General questions | |
F
fryon author
Is it possible in phprunner to compare two fields in two tables before entry into the database? |
|
J
|
Jane 8/5/2008 |
Hi, global $conn; $strSQL = "select * from catalog where idNo=".$values["itemNo"]; $rs = db_query($strSQL,$conn); if ($data = db_fetch_array($rs)) if ($values["itemqty"]>=$data["qty"]) { $message = "No enough stocks"; return false; } return true; |
F
|
fryon author 8/5/2008 |
Hi, use Before record added event on the Events tab for this purpose. Here is a sample:
|
J
|
Jane 8/5/2008 |
Try to use this code: ... $strSQL = "select * from catalog where itemCode=".$values["itemNo"]; ... |