Question: In my php program, I have to insert variables into one of my sql tables. Every time I go to test this out though, the values don't get posted to the table. Is there something wrong with these statements? or is the problem bigger than these 2 lines

```
$sqli = mySQLi_connect("localhost","root","root","myProject");

mysqli_query("insert into purchases (id, productID, quantity) values ($id, $productID, $quantity)");    

```

Answer: 
Look at [my white paper on Drools Design Patterns](http://www.google.at/url?q=http://www.redhat.com/rhecm/rest-rhecm/jcr/repository/collaboration/sites%2520content/live/redhat/web-cabinet/home/resourcelibrary/whitepapers/brms-design-patterns/rh%3apdfFile.pdf) especially the section on Data Validation.

The section explains a strategy that circumvents the straightforward creation of one Drools rule per rule in the requirements. Simply put, you use data to describe these rules, insert the data as facts, along with the facts representing actual data, and write rules relating the descriptions to the data. You might say that the rules "interpret" the descriptions against the data.

There are adavantages and disadvantages to this approach, but it ought to be considered before launching into handwritten or spreadsheet rules.
Look into **Drools decision tables**, which make it easier for someone to input those 1000 rules.