MySQL answers

  • 1answers
    How to deduct a percentage of the referral to the referrer?
    I wrote a referral system for an online store. But. You need to send a deduction of interest, for example 10% of the replenishment amount. This is a piece of code from the account that I bring referrals to. As a matter of fact, I don’t understand how to make deductions 10% of the replenishment ...
    MySQL Anonymous, Mar 17, 2019

  • 1answers
    How to parse xml file into mysql table using php?
    I'm not good friends with php, so I ask for help. The structure of the xml file looks like this: <column name="id">...</column> <column name="title">....</column> <column name="parent">95</column> <column name="id_group">50</column> ...
    MySQL Anonymous, Sep 7, 2019

  • 1answers
    How to find out which id was added to the Mysql database?
    if id has autoincrement and we issue INSERT INTO ... VALUES (NULL, ...) how to find out which id was added?
    MySQL Anonymous, Mar 12, 2019

  • 1answers
    Why are duplicate requests made?
    I continue to deal with the question How to get authors (users) using impatient lazy loading? . The problem with pagination has caught on. As I understand it, I failed to do the pagination correctly. Has anyone faced the same problem and how to fix it, if of course you can do it? Controller ...
    MySQL Xavier Pacheco, Apr 6, 2020

  • 3answers
    How to display an array from a database?
    Good day. Suppose the database contains an array in the form of a key = & gt; values ​​ 'ключ1' => 'значение1','ключ2' => 'значение2','ключ3' => 'значение 3', I am trying to display this array, but it does not work very well, it is displayed Array ...
    MySQL Anonymous, Aug 4, 2020

  • 1answers
    Ready solutions for creating reports from MySQL database?
    It is necessary to find some kind of ready-made universal solution that will allow the project manager to create reports from MySQL, without having to tug at programmers. If someone faced a similar problem - which products did you choose? The product should work on both Windows and Linux (Ubuntu)
    MySQL Anonymous, May 11, 2019

  • 2answers
    How to write a mysql query correctly?
    I have a table, I make a query to it and get a result like this: { id:1, name:'vasya', age:20},{ id:2, name:'petya', age:22},{ id:3, name:'zina', age:18} I have a second table that lists the hobby in userid - hobby format. I need to get the result like ...
    MySQL Anonymous, Jun 21, 2019

  • 2answers
    Why does the like operator work differently?
    Mysql, PHP, Apache (website) I use the like operator in my SQL query. PHP code is the same. The data is different. The result of the like operator's behavior is different. Strange. (The code is used in conjunction with ajax - a drop-down list, everything is standard.) // keyword - job ...
    MySQL Piper Boyer, Feb 18, 2020

  • 4answers
    How to import large database to mysql innobd - 87Gb?
    There is a database in 87Gb. I import it through the terminal, of course. There are 4 tables in the database and the last one with 450 million rows. She also gives such weight. My mysql config: [server]key_buffer_size = 10Gmax_allowed_packet = 10Gsort_buffer_size = 10Gread_buffer_size = 10G ...
    MySQL Aubrey Dougherty, Apr 8, 2020

  • 1answers
    How do I select a value FROM a staging table?
    There are three tables, in one table is a list of specialists, in the second a list of services, in the third table the relationship between specialists and services and the cost of services provided by a specialist. Now I can get a full description of the service associated with a specialist, ...
    MySQL Anonymous, Mar 13, 2019

  • 1answers
    Can I create a database with a user using PHP?
    php 7.0.17, mysql-5.5.50 panel on the server ispmanager 5 lite, there are no limits for creating databases
    MySQL Aden Wells, May 4, 2020

  • 1answers
    How to build such a simple compound mysql query ????
    Hello everybody. Please help me write a request. The limit value needs to be the result of the query. I can't do it in any way.
    MySQL Vivien Roth, Apr 23, 2019

  • 1answers
    How to protect the entire request from injection?
    Hello everyone. Moved to PDO. I use name placeholders for protection, it's very convenient. How to make a placeholder in a multiple array? $a = array( 11 => array('param' => 'параметр1', 'val' => 'значение1'), 22 => array('param' => 'параметр2', ...
    MySQL Aiden Stanley, Jan 28, 2019

  • 3answers
    How to build a MySQL table correctly?
    Good time of day! I am writing a small service for a school (React + PHP + MySQL). I will need to store a schedule for each class. The number of classes is unknown. I want the most simple structure. So far, the simplest one that comes to mind is this: id - index Class name - text ...
    MySQL Anonymous, Aug 7, 2020

  • 1answers
    Get data on daily or monthly limit?
    Good evening, guys, please help me for 4 hours. I've been puzzling, I can't do it. There are several products in the database, and they have a purchase restriction, Daily limit: 100 pcs. Monthly limit: 1000 pcs. If one product exceeds the limit of more than 100 or 1000, then the ...
    MySQL Anonymous, Nov 23, 2020

  • 1answers
    MySQL index on a field to sort?
    I have a table like this: id, entity_id, total_likes, total_comments, total_shares, created_at In fact, there are more fields, simplified for example. The request to her looks like this: SELECT * FROM table WHERE entity_id = ? AND created_at > ? ORDER BY total_comments For such a query, I ...
    MySQL Kira Khan, Jun 22, 2019

  • 1answers
    How to load products into OpenCart directly from DB to DB?
    In the database, there is a periodic replenishment of goods, where the product is a row in one flat table, 5 columns - name, article, price, category number (coincides with the id of already existing categories in the second database), an array of pictures (text field where the addresses of ...
    MySQL Ronan Stuart, Oct 16, 2020

  • 2answers
    Can such a sample be made?
    There is a table of goods and a table of aliases. They are finally not connected in any way. Aliases are somehow matched by cms and display information about the product. Alias ​​table: Products table: Here, as you can see in the aliases, there is a column in which strings like ...
    MySQL Anonymous, Apr 6, 2019

  • 4answers
    How to get authors (users) using eager lazy loading?
    I'm doing something like social. networks. Profile page. I get user posts. It is necessary to get more authors of posts, if any. But I don't know how to do it ( User Model: /* Получаем данные по пользователю */ public static function getUser(string $login = ...
    MySQL Anonymous, Sep 5, 2020

  • 1answers
    What is the best way to group data for database output?
    There is a table with over 1 million records, every day + 100k approximately. Each record is a unique record of the activity of a unique host. I have an idea. Once a day, run a script that will transfer (calculate, form) data from a table with 1 million records to a new one, where the number of ...
    MySQL Anonymous, Sep 28, 2019