Most voted "mysql" questions
Mysql is a relational database management system (RDBMS) that functions as a server, and provides access to multiple users simultaneously. Your source code is available under the GNU General Public License.
Learn more…10,264 questions
Sort by count of
-
1
votes2
answers35
viewsQuery String wrong with use of prepare. Wordpress
I have a problem building a query here: $sql = $wpdb->prepare("SELECT * FROM {$wpdb->prefix}imagens WHERE categorias LIKE %d limit %s, %s", array('%' . $wpdb->esc_like($var['busca']) . '%',…
-
1
votes1
answer561
viewsMysql SELECT with JOIN and LIMIT in child table
I have a table catalogo related to another table imagens. Each record in catalogo has N images. I need that in a SELECT with INNER JOIN imagens, only 3 images are returned for each table row…
-
1
votes2
answers544
viewsError starting nodejs+Sequelize+mysql project
When I try to start my project this giving the following error: D:\www\nodejs\master>node bin/www module.js:472 throw err; ^ Error: Cannot find module 'sequelize' at…
-
1
votes2
answers103
views"Error" upon completion of CSV import
Good afternoon, I created a code in PHP to read a . CSV containing Name, Email and IP. The goal is to consult the Geolocation API of http://ip-api.com/ and return me the state corresponding to the…
-
1
votes1
answer118
viewsTable with primary key that never repeats
I have a table Produto (id, descricao, tipo) and that same table is on three different computers. All three write data to your machine and from time to time send the data to a server. What happens…
-
1
votes1
answer475
viewsDuplicate Bulk Records - Run a query for each displayed record
I have a table where only accounts with your type = 'fixed are displayed' What I would like to do is run a query and duplicate all the table Records at once. At the moment I only managed to…
-
1
votes3
answers49
viewsSend form to database with Mysql and php
Can anyone help me know where I’m going wrong?! is giving this error in the field identification lines.…
-
1
votes2
answers253
viewsHow to store multiple user names in one variable?
I have a form, and in it I make a query in the database: private void Consulta() { var dataCom = Convert.ToDateTime(label1.Text).ToShortDateString(); var conf = $"select * from data where data_venc…
-
1
votes1
answer1338
viewsProblem with BETWEEN dates
I need a light for a question, I have a data filtering system (search) where I have to search for two Initial and Final dates. Since I have these two columns in the database, then when I run the…
-
1
votes2
answers119
viewsHow not to update empty fields
Would like to nay update the values sent as empty, as the second argument passed from example below, but I want to avoid using an IF, I do not know if mysql provides some function that can help me…
-
1
votes1
answer145
viewsSend images to different folders and write each one to a database table using php
I’m a beginner in php and I’m trying to create a website. How do I send 6 images at the same time through the form, have each one sent to the specific folder and save to the database. Name of tables…
-
1
votes0
answers81
viewsHow to use Mysql’s SELECT + WHERE dynamically?
I need to search the Mysql database, however I may have one or more filters (maximum 6) in the WHERE clause. Example: SELECT * FROM 'table_name' WHERE coluna_1 = 'valor_1' or SELECT * FROM…
-
1
votes1
answer45
viewsMy form does not save the data in the database
dry my view: {!! Notification::showAll() !!} {!! Form::open() !!} <div class="panel panel-default"> <div class="panel-heading"><h2> Cadastro Escola </h2></div> <div…
-
1
votes1
answer114
viewsThis gives error: Can’t create table when creating this table in Mysql using Foreign key
create table clientes ( cpf varchar(15) primary key, nome varchar(50), rg varchar(10), dt_nascimento date, senha varchar(10), rua varchar (20), numero varchar(6), bairro varchar(20), cidade…
-
1
votes1
answer62
viewsHow to add server elements
Hi, I’d like to know how to add up the values that pass me from the server. I created a system that controls expenses/accounts, you register one of your accounts. EX: Name: Car Value: R$ 10,000 (per…
-
1
votes1
answer301
viewsWhy is the id ambiguous even creating an alias?
select deals.id as dealid from funnels inner join deals on deals.funnel_id = funnels.id where id = 3 returns 1052 - Column 'id' in 'Where clause' is ambiguous My database is Mysql. Why there was…
-
1
votes1
answer52
viewsHow to group records per day using Unix Timestamp?
I would like to group the results by days that belong to the period defined in the query. SELECT count(*) FROM historico WHERE contato_id IN (19, 45) AND createdAt BETWEEN 1556668800 AND 155936879;…
mysqlasked 5 years, 5 months ago Victor Carnaval 2,430 -
1
votes1
answer71
viewsHow to create conditional structure in SQL?
I need to create conditions for the attribute nome and idade, which are: For the name: Reject nomes containing the word %mentiroso%. For Age: Reject idades < 1 || > 130. Follow the creation of…
-
1
votes0
answers891
viewsSet up a dynamic survey
How to do a filter search in the database using this example below: The bank variables are: Nome Professor T | Matricula T |Nome Professor S | Matricula S | Nome Professor A | Matricula A | Turma |…
-
1
votes0
answers50
viewsSelect in varchar column containing only one word
How to run a SELECT SQL that only looks for VARCHAR type results that contain only one word? That is, I don’t want results with more than one word
-
1
votes2
answers343
viewsselect Count within select
With the query below this returning the total values of each month, however I need to count the quantities of times each item has in each month. SELECT instancia, (SELECT COUNT(instancia) FROM urt…
-
1
votes1
answer83
viewsProcessing cost between code and database
Among the many forms of development, there was a doubt about what will consume the most of my processing between the same operation in different ways... If I have a function that can be done…
-
1
votes2
answers283
viewsCount numbers drawn on a lottery table
I am new to BD studies and I have a table with the results of Lotofácil where I would like to do a Count that looked for, for example, how many times the tens 20 was drawn. I have done several tests…
-
1
votes2
answers117
viewsSort mysql query by numbers present in varchar column
I have a table with a varchar column and I want to perform a SELECT and sort the result by the numbers in that column. The table: name: coins columns: id, name, price, catalog The catalogue column…
mysqlasked 5 years, 5 months ago Developer1903 717 -
1
votes0
answers54
viewsConnect PL/SQL to a MYSQL database
I have a MYSQL database, I would like to connect to it using my pl/sql development environment, is that possible? And I do?
-
1
votes2
answers264
viewsSQL syntax error when updating a record in C#
When I run my program to update a record, I get the following syntax error But my SQL syntax is correct: string comando = "UPDATE cliente SET nome = '" + dto.Nome + "', SET email = '" + dto.Email +…
-
1
votes1
answer46
viewsText not inserting line break
I did a search and found no post about the problem I’m facing. I’m running a database search and writing on the screen what I find. But when the text is displayed it is not inserting line break, so…
-
1
votes1
answer95
viewsHow to know the result number inside a loop with mysqli_fetch_array?
How to know the result number within a loop with mysqli_fetch_array to have a condition that separates the first from the rest? On my table sql only contains a single entire field id. What I want to…
-
1
votes1
answer211
viewsFormat JSON - PHP and Mysql?
I need to ride a json as follows: [ {"SUPERMECADO 1": {"telefones": [ "1999999999","1999999991"]} }, {"SUPERMECADO 2": {"telefones": [ "1999999992","1999999993"]} } ] But currently my SQL is…
-
1
votes1
answer24
viewsMYSQL grouped query
I have a table where the fields are: cod_patient cod_pathology leading a patient may have more than one pathology, but one must be defined as principal, need to filter which patients have no items…
-
1
votes1
answer512
viewsSub-Select with MAX / SUM / INNER JOIN?
I need to make a SUM within a MAX to return higher product billing within a summary. I got by doing this: SELECT MAX(Faturamento) MAX_Faturamento FROM (SELECT SUM(P.preco * I.qtde) Faturamento FROM…
-
1
votes0
answers98
viewsMysql + Bad Gateway Nginx php connections peak
I have at AWS: RDS M5.xlarge Mysql 5.6 EC2 t2.small NGINX + PHP 7.1 Intermittently, my Mysql is getting a peak of connections, 20 to be exact. And every time that happens, "Bad Gateway" appears on…
-
1
votes0
answers134
viewsError opening XAMPP connection in Mysql Workbench
Good evening, when I create a connection in mysql Workbench to access XAMPP, this message appears below and the phrase "could not be feched" next to the submenus of the database. Some solution?…
-
1
votes3
answers694
viewshow do I make a row_number keeping the document number with different plots?
I would like to know how to create a row_number keeping the numbers of documents equal creating the sequence by parcel. example: doc / cliente / parcela 10 15 1 10 15 2 10 15 3 23 59 1 23 59 2 23 59…
-
1
votes1
answer282
viewsHow to pass a php variable inside a Whatsapp link?
I want to create a Whatsapp button that contains the user number registered in the database, but I’m not able to link my variable in this link. Contato:</b> <a…
-
1
votes2
answers57
viewsHow to insert separate data?
I want to insert data into a table in the database, but there are no mandatory fields, how should I proceed with this, because I can’t perform the command this way for example: MySqlCommand command…
-
1
votes3
answers292
viewsHow to use a two-dimensional array with Javascript (jquery)?
I believe my question has become too superficial, but I explain the situation in more detail: I already have the code and it works partially follows; $(document).ready(function() { var url =…
-
1
votes0
answers22
viewsHow to make a session message appear only when trying to register?
<?php session_start(); $pdo = new PDO('mysql:host=localhost;dbname=login','root',''); $email = $_POST['email']; $senha = $_POST['senha']; $insert = $pdo->prepare('insert…
-
1
votes2
answers656
viewsMysql query with PHP
I’m making an appointment at Mysql to return the quantity of orders that were not delivered. To see what was delivered I do: $result = mysql_query("SELECT operacional FROM `pedidos` WHERE `status` =…
-
1
votes2
answers113
viewsImprove a Bank Search
I would like an improvement help in a Search Query today every Search the user makes in the search field I give an OR in my Where I wonder if you have any better way to do this because I will need…
-
1
votes1
answer3608
viewsWhat is the difference between LEFT JOIN and LEFT OUTER JOIN?
What’s the difference between LEFT JOIN and LEFT OUTER JOIN? Can you give me some examples?
-
1
votes0
answers52
viewsHow to define a minimum time interval between database inserts?
I have a submission form, where you add comments to the database and show them on the page. The problem is, I want to draw up a form so people can only make submissions every 10 minutes. That is, a…
-
1
votes1
answer343
viewsHow to make a Radius calculation in SQL, using Mysql, with two conditions?
Hello, I already do a radius calculation in SQL, using Mysql and PHP, which takes the location of the device (latitude and longitude) and filters the radius according to the location of the device.…
-
1
votes0
answers319
views -
1
votes0
answers102
viewsInstallation error, Mysql server crashing
I have recently reset my pc, now that I am installing Mysql by intaller community all services are installed with the exception of Mysql server. has already been installed the version 2010, 2013 and…
-
1
votes1
answer251
viewsHow to search for relevance in Mysql (prioritize whole word)
I have a recipes site in PHP and Mysql. The consultation is: SELECT receita FROM receitas WHERE receita LIKE '%mac%' When I search for "mac", it brings "macaroni" and "big mac". I wanted the result…
-
1
votes1
answer80
viewsLogic to display data - Slice days
Good night. Using PHP, I search data with Mysql. The table has the following structure: ID | dataHoraInicio | dataHoraTermino | 1 | 2017-05-08 11:28:40 | 2017-05-08 17:52:12 | 2 | 2017-05-08…
-
1
votes2
answers984
viewsHow to update data from a table only if the new values are different from the current ones?
How can I do an UPDATE only if the data sent is different from the data stored? I’m with the following: <?php header('Content-type: application/json'); header('Access-Control-Allow-Origin: *');…
-
1
votes1
answer634
viewsLogin via facebook SDK
Well recently I made a login page where you have the normal login and the by facebook, only when login by facebook when you click redirects to the application to allow access, ok so far so good,…
-
1
votes1
answer4491
viewsSafe update error using stored Procedure in MYSQL
I am having trouble updating my stock table using a stored Procedure in MYSQL. Follows the code: CREATE DEFINER=`root`@`localhost` PROCEDURE `atualiza_estoque`(id_produto int) BEGIN update estoque e…