Jump to content

Any function to check invoice id other than "checkCbInvoiceID"?


sufi

Recommended Posts

I need to check for valid invoice id from an array of ids. Problem with checkCbInvoiceID is, it kills the script (die()) once it find one invalid invoice id. So I can't run it through the array. Is there any alternative function to check invoice id, which will not kill the script?

Edited by sufi
Link to comment
Share on other sites

Database query will do it

$invoiceExists = Capsule::table("tblinvoices")->where("id", "=", "{invoice-id-here}")->count();

if ($invoiceExists){
   // Invoice Exists
}
else {
   // Invalid Invoice ID
}

 

Thanks. I was checking if there was any builtin function i can use. But, yes database query also solved my problem.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated