Relative Content

Tag Archive for phpmysqllaravel

Delete video from sql database doesn’t work in Laravel

So, I’m making a streaming website in laravel php and I am trying to make a watchlist function. The button to put data in the database works. Where it begins to become a headache is with the remove button, when I click on the remove button it just refreshes my page and my database stays intact. I have a second problem: my videos-cards don’t display on the watch list page (this is just a minor problem, the biggest problem is the database removal).

Merge data with different column names

I have 2 tables and there is data for users. I want to take the data between the specified dates from these 2 tables, add them together if the same user is in the 2 tables, and write them as a single data if not. I made a join operation as follows, but the unionAll method combines the data in the 2 SQL results, but does not collect the same user data. For example, the user with id 1 is recorded in a table as publisher_id and the column name I want to collect is ticket. In the other table, there is a record as user_id and the column name I want to collect is diamonds. If the ticket value is 10 in one table and the diamonds value is 20 in the other table, the result should be 30, but two separate data are coming. How do I do this merging using the paginate management?