Skip to content
Advertisement

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 only be unique

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 products I made a subquery for this But it gives Error:

I can’t get the correct output when I use / ORDER BY from my SQL example?

I was playing around SQL sample that I wrote and I’m quite surprised that I couldn’t get the correct output when I use less than, greater than or ORDER BY. for example, select player_name, jersey_number from Players order by ‘jersey_number’ desc; it should give players name and jersey number sort descending order from their jersey number. However, this is what

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 about triggers today so I’m not knowledgeable

Insert selected columns from one table to another SQL

I have two separate databases in the same host (localhost:3306). I have one table from the first database and a second from the other database. Here is 2 screenshots to become more clear I need to match: Is there any automatic way with a software? Need I to write some specific query to copy these 4 columns from one table

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 ->

Php – cannot create new database record because primary key is null (autoincrement)

There are two tables: address and person. person_id (primary key, autoincrement) is a foreign key to address. I am trying to add an address record and person record from the same form but am getting this error. Uncaught Error: Attempt to assign property “person_id” on null in C:xampphtdocsappcontrollersMain.php:22 Stack trace: #0 [internal function]: appcontrollersMain->insert() #1 C:xampphtdocsappcoreApp.php(52): call_user_func_array(Array, Array) #2 C:xampphtdocsindex.php(4):

Advertisement