#It did not work to add people to duplicate (not to repeat and already exists same account only once)

20 messages · Page 1 of 1 (latest)

echo steeple
#

So you have three (3) different database connections, with the same database table name in each, and you are trying to keep all three the same?

idle stirrup
# echo steeple So you have **three (3)** different database connections, with the same database...

correct, Look, this is the same DB account, fine, but another different table, that's it, but look here:

     ->table('list_participants')
     ->updateOrInsert(
         ['id' => $id],
         [
             'people' => "$newPeople/$maxPeople"
         ]
     );```

for example when it is already 1 / 30 (ready to approve that insert and send) and then again repeat 2 / 30 that problem (you already have an insert account) without problem and only problem that 2 / 30, 3 / 30... etc that.

Maybe it's a problem, right?
#

to correct edit

echo steeple
#

It looks like you may not be utilising Eloquent and relations as well as you perhaps could be?

#

For example, why do you have a table:
"participants_{$partid}"

#

Using Eloquent and proper relationships, you may find it easier to work with your data

#

If you can share your UML/Database Diagrams, it may be easier to help

idle stirrup
#

@echo steeple Yeah well, write my message private check my zoom or anydesk desktop? check my look web and explain.

echo steeple
#

It'd be better for everyone if it's just on here, that way anyone else can read it and help, or learn
Do you have an Eloquent model that matches up to your table for "list participants"

Is a "participant" a User Model or something similar?

What does a "participants ###" table look like? What is its purpose?

#

I think using Eloquent will help you here,
The key next steps (in my opinion) are:

  • Standardising the approach a little, use the benefits of the Laravel framework

  • Rationalise, and determine Eloquent Models, and use Eloquent rather than DB: facade to manage.
    E.g.
    "Users"
    "Servers"

Do you have further splits (for example - channels?) - if so, consider using the Eloquent Model approach here too.

  • Review what you're doing with the data, separate data as need be (e.g. separate your 'people' field into 'current_people' and 'max_people'), rather than adding strings in which may complicate working with the data
idle stirrup
#

sorry back. and but is large much code full!

idle stirrup
#

okay well explain:

#

there button "opened" and there 18/40

#

when button done 19/40 and success participants.

#

and again opened button 20/40 and "already exist you participants"

#

but problem there number stop "duplicated". 21 / 40 ..... etc