This topic is locked

Outstanding invoice

1/29/2024 10:00:07 AM
PHPRunner General questions
L
leteck author

Im trying to create a outstanding order function and I need to check invoice date and compare with current date to see which invoices do I have to process. My question is...Where do I have to put the code? I try after login sucessfull but I gor errors if I use :

//** Check if specific record exists ****

$rs = DB::Query("recurringorders where recudatec = date(now()) ");
$data=$rs->fetchAssoc();
if($data)
{
echo " EXIST";
}
else
{
echo " NO EXIST";
}

admin 1/30/2024

You need to be more specific. What kind of errors you getting? It can be a problem with the code itself, not with the code placement.

L
leteck author 1/30/2024

This is the error:

Fatal error: Uncaught Error: Call to a member function fetchAssoc() on bool in C:\Apache24\htdocs\Vitallgx\include\events.php:88 Stack trace: #0 C:\Apache24\htdocs\Vitallgx\classes\loginpage.php(523): class_GlobalEvents->AfterSuccessfulLogin('XXX', 'XXX', Array, Object(LoginPage)) #1 C:\Apache24\htdocs\Vitallgx\classes\loginpage.php(339): LoginPage->callAfterSuccessfulLoginEvent('XXX', 'XXX', Array) #2 C:\Apache24\htdocs\Vitallgx\classes\loginpage.php(185): LoginPage->doLoginRoutine() #3 C:\Apache24\htdocs\Vitallgx\login.php(47): LoginPage->process() #4 {main} thrown in C:\Apache24\htdocs\Vitallgx\include\events.php on line 88

admin 1/30/2024

Most likely your query returns no data or is simply incorrect. Did you test this query outside of PHPRunner?