I have a query:

$query->select( $db->quoteName(

    $query->join('LEFT', '#__receipts_payment_detail AS b ON b.idfkpayment_detail = a.id');
    $query->join('LEFT', '#__order_reminder_sent AS c ON a.id = c.orderref');
    $query->where($db->quoteName('a.receipt_patient_id') . ' = '.$idAuto);

this works when I substitute a value for $idAuto like 2150 or similar. However if I set the value of idAuto in code then it throws an error.

 **Call to a member function format() on bool**

I've tried lots to fix but don't understand why it works with a value as opposed to a variable.

Any ideas?

  • The error isn't coming from any code you posted. Inspect the stack trace and post the relevant code.
    – Sharky
    Apr 2 at 18:35
  • Thanks @Sharky I wasn't concentrating and tried to format the returned date object wrongly in the next line of code: $date = DateTime::createFromFormat('Y-m-d H:i:s',$smsdetail->smsorderdatesent)->format('d-m-Y H:i:s'); which was throwing the error Apr 3 at 10:49
  • Can you please post your comment as the Answer and then accept your Answer so that the question doesn't look like it is unresolved. You may also consider updating your original question with the code snippet that was failing and perhaps reflect the real issue in the question title to help others researching their own similar issue in the future.
    – Irata
    Apr 3 at 23:56


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.