Jump to content

database connection issue


hmaddy
Go to solution Solved by hmaddy,

Recommended Posts

anyone help me or correct the string.

 

foreach (Capsule::table('tblhosting')->where("domainstatus", "=", "Active") && (Capsule::table('tblhosting')->where("packageid", "=", 264) || (Capsule::table('tblhosting')->where("packageid", "=", 265)   ->get() as $client) {

Link to comment
Share on other sites

  • Solution

foreach (Capsule::table('tblhosting')->where("domainstatus", "=", "Active")  ->where("packageid", "=", [264,265])    ->get() as $hosting) {

 

1. when i enter wherein, its not working. when i enter where, its shows only 264 id details 

2. $auditdate=$hosting->nextinvoicedate; not working or not transfer any data to new variable. but when i use echo $hosting->nextinvoicedate; its prints the value correctly. how to copy the value to a variable

 

 

Link to comment
Share on other sites

54 minutes ago, hmaddy said:

foreach (Capsule::table('tblhosting')->where("domainstatus", "=", "Active")  ->where("packageid", "=", [264,265])    ->get() as $hosting) {

 

1. when i enter wherein, its not working. when i enter where, its shows only 264 id details 

2. $auditdate=$hosting->nextinvoicedate; not working or not transfer any data to new variable. but when i use echo $hosting->nextinvoicedate; its prints the value correctly. how to copy the value to a variable

 

 

$users = DB::table('users')->whereIn('id', [1, 2, 3])->get();

https://laravel.com/docs/7.x/queries#selects

Link to comment
Share on other sites

its solved with following commands.

 foreach (Capsule::table('tblhosting')->where("domainstatus", "=", "Active")  ->whereIn("packageid", [264,265])    ->get() as $hosting) {

$auditdate=$hosting->nextinvoicedate; = blank data.

but <?php echo $hosting->nextinvoicedate .  PHP_EOL; ?> works the correct data.

 

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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