Hi Everyone,
On the add and edit pages of my 'weighbills' table I am running the following query:
$strSQLExists = "select rate from routes where Date Start
<'" . $values["Date"] . "' and Date End
>'" . $values["Date"] . "' and Route ='" . $values["Route"] . "'";
$rsExists = db_query($strSQLExists,$conn);
$correctrate=db_fetch_array($rsExists);
$values['Rate']=$correctrate;
It basically has to select the value for 'rate' from the 'routes' table where the 'date' on the add page is between 'Date Start' and 'Date End' and the 'Route' value on the add / edit page matches the value in the routes database.
When I save the information on the add/edit page I get the following error:
mysql_query() expects parameter 2 to be resource, null given
this is the query itself:
select rate from routes where Date Start
<'2013-01-10 00:00:00' and Date End
>'2013-01-10 00:00:00' and Route ='Kangra-R/Bay'
Can anyone help me with this, or maybe suggest an easier way that I can implement this using the "Where" or "Create new query" functions under the Lookup wizard?