Right now I’m running both of these queries with PHP: UPDATE members SET balance = balance – $cost WHERE id = ‘$member’”); UPDATE campaigns SET h_hits = h_hits + 1, d_hits = …
Tag: mysql
Best practices when storing multimedia posts SQL DB
I have searched StackOverflow for an answer to this question, and I’ve been surprised to find very little information for what seems to be a very common task Let’s say I have an app that allows users …
Is there effective way in laravel to select records from database and set them user_id?
I have to make laravel application that use database 100k+ records. I have table with columns: numer, date, segment, user_id. I am selecting records that I need with: $datetime = new DateTime(); $…
Convert Raw SQL ‘NOT’ IN (too slow) to Laravel Eloquent
I have a running script using Raw SQL in Laravel 5.3 controller which I found it slow and not secure ( as Raw ). If there any way to make it more effecient and convert it to eloquent or Query Builder …
Selecting an attribute that has max value for another attribute
**** Edit: How do I also consider the case where there is more than one property with the highest value? I’m trying to write an outer query that takes the propertyname with the highest value from an …
Showing multi row in one row
I am developing a page where I have to show all the jobs of an employee with a work number and the total of each type of hours in each work I can display it, but, my problem is when the employer …
Is there a way to import all databases into one database with Mysqldump?
I want to gather automatically all my databases into one with Mysqldump, is there a way to do it ? For example what I want is to move all the tables from DB1, DB2 and DB3 into DB4 (DB4 can already …
Select all subscriptions whose users don’t have any other active subscription
I am writing a subscription cleanup query that should select all canceled subscriptions, whose users don’t have any other active subscription (the application allows multiple subscriptions per user). …
Query to check relationships between columns?
I currently have a table called User_Followers this table has the following columns: User_Id Follower_Id I’m trying to build a query that will retrieve all the people a user is following but no …
Select within the same table
I’m studying SQL statements and i got stucked in this scenario. The problem is to select data that has associantion column with another in the same table, the result that i want is to select ” Name …