Skip to content

Tag: phpmyadmin

Sync columns(without data) in multiple tables

I have multiple tables inside my database: Is there a way to keep the columns of all the tables in sync with each other? What I mean is that when I add a new column named ‘⁣last-edit’ inside the first table, this column will duplicate to all the other tables. But the data inside the columns will o…

Error => #1242 – Subquery returns more than 1 row

I am selecting order data from my orders table with that I also need the order product’s count which contains a specific word Account TopUp 200, Account TopUp 500, Account TopUp 1000, The order contain multiple product means one order contains both(Account TopUp 200, Account TopUp 500) and other product…

SQL: set trigger to get the sum of rows

This is the results table: I want to create a trigger that will sum up the rows get_ca1 + get_ca2 …+ get_exam and store the total in the get_total column. When the rows get_ca1, get_ca2,… get_exam are inserted, the trigger should calculate the total and store in the get_total column. I just learnt…

Update user id by looking up two other tables

I have a table/sql issue I don’t know how to solve. I need to update/create a table of user ids with order ids. Therefore I have to get a new user_id, by searching for the email in an old list. With the email adress I need to look up the new user id. So the logic is like: order_id ->