mysql

How do I insert a row into a MySQL table with duplicate checking? INSERT INTO / WHERE NOT EXISTS in MySQL

Hello everyone, I'm trying to insert a new record into the table, with a duplicate check. After executing the request, I have ... e does not have a row with a field that corresponds to such and such an IDshnik (the ext_id field, it is unique for all rows)

Fate date value in MySQL update

The MySQL table has a datetime field that stores the date (the pay field) before which the user paid for access to the site. ... possible somehow should I include this in the request? In order not to "pull" the table first by extracting the value of pay

MySQL: why doesn't while or any other loop work

I decided to study MySQL a little bit with MSSQL and immediately came across a problem... Q: Why doesn't it work? SET @coun ... () BEGIN SET @counter = 1; WHILE (@counter < 20) DO SET @counter = @counter + 1; END WHILE; END Where am I stupid?

Why in MySQL (MariaDB) does the loop not work even in the procedure?

2 UPDATE: Something to think about: delimiter ;; drop procedure if exists test2;; create procedure test2() begin select ‘He ... t do it... I ask the moderators and users to help in this matter, and not to give the tag duplicate and set downvote. Please!

How do I update all id fields with a single request?

Let's say there is a table articles with the fields id,title,text.id this is a field with auto-increment, but in this field t ... in one query to order its values, and the second request to restore the field title, this is for training purposes, you need

php user registration, checking the uniqueness of values

I'm doing user registration for my site, I'm learning php not so long ago. I get the data from the form -> then I check t ... what data. If anyone has examples from practice and code on how best to do user registration today, I will be very grateful.

Error Notice: Use of undefined constant

In the loop, the following function is executed twice in a row: function CodeToURLImg($code) { $sql_catalog = 'SELECT Im ... etcat/full.php(127) : eval()'d code on line 121 Both times, the same value was passed to the function. How do I fix this?

MySQL: INSERT... VALUES, INSERT... SET and hybrid version

When reading the legacy code, I found an SQL query to MySQL of this type: INSERT INTO table (field1, field2, field3) V ... just redundant code that can be cleaned up and brought to either the standard variant (1) or the MySQL-specific variant (2)?

Question about MySQL for Node.JS

I create bots for Discord using the discord module.js for Node.js. I use a MySQL database for storing users. So, in my bot th ... }) } module.exports.help = { name: 'personal' }; Please help me, I have 4 days can not understand what I'm doing wrong!

php> MySQL registration form (size of the first letter)

The site has a simple registration form. We enter some data in our case (login password) and they get to us in the database. ... > <p><br/><input name="submit" type="submit" value="Отправить"/><br/></p> </form>

Cross query sql php

Can you please tell me how to display on the page in the table not the id, which is in the database, but the value itself, wh ... ators` WHERE data_id_station = '".$_GET['id']."' Can you tell me how to correctly output the data, and not the id? Base:

Setting the UTF-8 encoding for the current MySQL connection [duplicate]

This question has already been answered here: ... same table using PDO, when setting the encoding: $db->exec('SET CHARACTER SET utf8') The fields were returned in UTF-8.

PHP, MYSQL UPDATE

Iterating through values in loops does not work for, foreach. More specifically, after deleting a row from a table, update t ... he db enters the total value of the rows after deletion in the update . That is, instead of 1, 2, 3 ..., it writes 2, 2, 2...

Data normalization

The task is to normalize (0-1) the order stack in stock trading. In the glass, I can only see the 25 best price offers, i.e. ... base for normalization? And if so, how?(Orders are quickly canceled/appear and it is not clear what data should be recorded)

Mysqli set charset () refuses to work

Hello. I can't figure out why the function refuses to work. $db->set_charset("utf-8"); Returns false for some reason. The ... ding refuses to change. I tried for the sake of experiment to change to some windows-1251 - also does not work. Where to dig?

Resetting MySQL Password in Windows

How do I reset my MySQL password on windows?

Windows-1251 vs UTF-8

I create websites using my own PHP engine developed somewhere in 2007, which has since undergone all sorts of modifications a ... there any advantage at all? And another question, please tell me how to correctly switch to UTF-8, including MySQL database?

Sort by date in mysql-months are displayed in reverse order.

Hello. When sorting by date, the sorting is done by numbers, but the months are displayed in reverse order-November, October. ... month ORDER BY date DESC" What should I fix so that everything is displayed correctly - days and months in ascending order?

Visual Studio Code-false errors on the correct MySQL syntax

Why per line: ALTER TABLE users ADD `date_practic` VARCHAR(10) NOT NULL AFTER `date_exam`; Visual Studio Code returns a synt ... the kbd tag) is a syntax error? After all, this is exactly the MySQL syntax. Or is Visual Studio a bad editor for MySQL code?

How do I log in to MySQL Server in Docker container?

I built an image based on this Dockerfile:https://github.com/mysql/mysql-docker/tree/mysql-server/8.0 docker build . --tag my ... if it is ready mysqladmin --defaults-extra-file=/healthcheck.cnf ping else # Initialization still in progress exit 1 fi