P
P
pimanov32019-06-19 16:08:50
MySQL
pimanov3, 2019-06-19 16:08:50

SQL queries. How to get the content and re-upload if...?

It is necessary to get the number in the 'messages' column in a certain line by the first request, knowing the contents of another 'user_id' column of the same line (for example, 12345) . The table has an ID column (maybe needed).
The second query needs to return new content in the same row of the 'messages' column knowing the contents of the 'user_id' column of the same row.
Additionally:

// Параметры для подключения
    $db_host = "localhost"; 
    $db_user = "123"; // Логин БД
    $db_password = "pas"; // Пароль БД
    $db_base = 'bd'; // Имя БД
    $db_table = "table"; // Имя Таблицы БД

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Valery, 2019-06-19
@pimanov3

get
select messages from table where user_id = 12345
change
update table set messages = 5 where user_id = 12345

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question