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
votes1
answer837
viewsreturn array(array) of a php function
I am storing the data of a database in an array in a file called php functions.: while($line = mysqli_fetch_array($execute)){ $tabela[$a][$b] = $line['Activit']; $tabela[$a][$b+1] =…
-
1
votes1
answer59
viewsSqlgrammarexception
Good night! Someone can help me with the error in my code, I followed the teacher’s steps but presents error in mine and not in his example. I am using the same dependencies. Follow the method…
-
1
votes1
answer713
viewsDate function in Portuguese
I have this code <table class="table table-hover table-bordered table-condensed lista-clientes table table-striped table-bordered table-condensed"> <thead> <tr> <th>…
-
1
votes2
answers83
viewsQuery mysql return 4 Counts same table
I would like to make a select in the same table that counts 4 different values, all with clauses, I’m trying this way but I’m not getting it, I want each Count to be done in a STATUS where I specify…
mysqlasked 6 years, 9 months ago Gustavo Souza 456 -
1
votes2
answers61
viewsQuery with Internet
I need to check if a data in Table 1 is represented in table 2 In the tabela1 ID | NOME | PARCELAS | DATA | NF In the tabela2 ID | VALOR | PARCELA | VENCIMENTO | NF SQL query with INNER JOIN I may…
-
1
votes3
answers838
viewstake input value Hidden within a <td> tag
how to get value of this input inside the table with data from the bd: HTML CODE <table id="tbl_3" class="table table-striped table-bordered table-hover"> <thead> <tr> <th…
-
1
votes1
answer105
viewsJquery - Redeem the value of a 'td' and insert into a Text
Good night , Next galley, I have a table from which I use the data from mysql , wanted to take the value of td ,and insert inside a TEXT that will appear inside the TD of the table with the value…
-
1
votes1
answer81
viewsAggregated function with MIN(), GROUP BY and Subquery
I am facing problems to mount a query of an address table with latitude and longitude. I have a function that does a distance calculation, I called it: distance_latlng_km(originLat, originLng,…
mysqlasked 6 years, 9 months ago Italo Izaac 185 -
1
votes1
answer48
viewsHow to use NOT IN with data from another server in PHP
I set up a table with Data that nay should be sought, I’ll call you here Table. The data that was in this table are these: |Tabela_Not| Londres Tóquio Paris And I applied this Query to make the…
-
1
votes1
answer42
viewsRecording value of a variable in a table
I’m trying to save the data of 2 variables in a table, but when I look at the table in the database is recorded the values as 0. public void inserir(List<Conta>list) { List<Conta> lista…
-
1
votes3
answers479
viewsComplex SQL with Mysql
I have these tables and need to do an sql command to receive this answer. I use Mysql. I tried it like this and returns zero in all codes: SELECT COUNT( ei.sexo_id ) AS total_sexo_masculino,…
mysqlasked 6 years, 9 months ago Luis Souza 333 -
1
votes1
answer69
viewsMysql query based on checkbox result
I’m having trouble creating a mysql query based on checkbox. 1. I have a form based on a select that contains a checkbox by line <input type="checkbox" name="check[]" value="<?php echo…
-
1
votes2
answers5173
viewsCheck if you returned records in select PHP
I need to check if my 'Select', is returning records to then load the data on the screen. Below follows the code I am using: $sql = mysqli_query($conn,"SELECT * FROM USUARIOS;");…
-
1
votes2
answers138
viewsAutomatic cast with Typescript?
To the point: There is a way to cast automatically using an interface as a model in Ionic (Typescript + Angular 5)? If not, you can make Lint recognize that an object coming from the server is not…
-
1
votes1
answer1916
viewsWarning: initialization makes integer from Pointer without a cast [-Wint-Conversion]
I have the following C code that connects to a mysql database and performs a query: #include <mysql.h> #include <stdio.h> int main(void){ MYSQL Connection; MYSQL_RES *res; MYSQL_ROW row;…
-
1
votes2
answers1539
viewsMysql Query with recursive N levels
I have the following query select id, nome, user_id from (select * from users order by user_id, id) users, (select @pv := '2') initialisation where find_in_set(user_id, @pv) > 0 and @pv :=…
-
1
votes2
answers242
viewsConsultations in Laravel
I’m trying to run a query on Laravel, in the terminal works perfectly, but when I insert in the Laravel, the same returns me empty, example: Consultation: SELECT MAX(positions.id), devices.name,…
-
1
votes1
answer348
viewsHow to cascade an Insert into several tables at once, when one works the other?
I have a table with the name of questionnaire, questions and answers. I need to do an Insert in the question table, right after receiving the question table id, for when to insert the questions I…
-
1
votes2
answers134
viewsHelp to simplify query sql
I have a huge sql query: select l.no_cidadao, extract(year from l.dt_cad_individual) ano, extract(month from l.dt_cad_individual) mes, date_part('year',age(now(), l.dt_cad_individual)) diferenca…
-
1
votes1
answer45
views"Column 'Value' in found." when fetching balance in query
I’m building an ATM simulator, with the features of Deposit, Withdraw and Extract are functional. However, I’m not getting the balance. I have the method emitirSaldo() which must receive the value…
-
1
votes1
answer84
viewsDoctrine prepare->execute
Hi, I’m doing this consultation with Doctrine $retorno = $em->getConnection()->prepare(" SELECT t.id_programa_fidelidade_diario, t.loja, t.nota, t.data, t.ecf, t.operador, o.nome,…
-
1
votes1
answer21
viewsSend more than one record to the same register in the Database
I have dependency registration with the form sending correctly to the BD. I have come across the problem that I have not noticed that the worker may have more than one dependent, I would like to…
-
1
votes2
answers114
viewsSearch with null value, mysql
I’m a beginner in programming and I’m trying to find something new, in this case, I have two fields that inform my research values, but I wish the research could be done even if a field is null This…
-
1
votes2
answers1931
viewsError: "Column Count doesn’t match value Count at Row 1" when inserting value in table with Trigger
After creating the Trigger: DELIMITER # CREATE TRIGGER BACKUP_PRODUTO_INS AFTER INSERT ON PRODUTO FOR EACH ROW BEGIN INSERT INTO BACKUP.BKP_PRODUTO VALUES(NULL, NEW.IDPRODUTO, NEW.NOME, NEW.VALOR,…
-
1
votes0
answers351
viewsToo much delay in query only in Mysql
Here in the company we have PG and Mysql databases, these two banks are networked and are identical in both structure and data, where a "robot" mirrors them every 10 min. So far so good... It turns…
-
1
votes0
answers360
viewsCreate filter in a graph
I have the following chart that works with the following code: <html> <head> <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>…
-
1
votes0
answers454
viewsError changing password (MYSQL_ROOT_PASSWORD), in Mysql Docker.compose.yml file
I had to recently change the administrator password of my database (currently using Mysql), changed the password 'MYSQL_ROOT_PASSWORD' but did not reflect changes in my container. I tried to delete,…
-
1
votes2
answers66
viewsHelp with Multi Array
Hello someone can help me how to create a list with php this type of array. The data comes from two tables, Categories and Products. I am using Mysql to fetch data from both tables. My tables:…
-
1
votes1
answer65
viewsmysql random questions
I have a somewhat complex question and I need help: I have a database with the following links: Exemplifying: I am in the history class about Karl Marx. This class is linked to a certain group of…
-
1
votes1
answer38
viewsQuery to return the value that comes before a specific character
I have a table called answer which is filled with answers to certain questions, each answer usually begins with the letter that would be the answer, for example: a)..., b)..., c)... ou d)..., the…
mysqlasked 6 years, 8 months ago Miguel Silva 491 -
1
votes1
answer221
viewsHow to determine the most suitable data type for a fixed-size numerical field?
I’m having a doubt about the characteristic of some attributes of my table. Problem: I have to keep an identification number of my items, this is always composed of 3 digits (zero left in case of…
-
1
votes1
answer106
viewsCreate type=Submit input inside the calendar code
Calendar code with checkboxes on each day of the month to mark meals: <?php # PHP Calendar (version 2.3), written by Keith Devens function generate_calendar($year, $month, $days = array(),…
-
1
votes1
answer60
viewsinsert only the row that receives value in the date column
I have this code: <?php $result_cursos = "SELECT nome, Quarto FROM centrodb.utentes WHERE descricaovalencia = 'LAR' AND nome <> 'CLASSE' AND ativo = '1' ORDER BY nome ASC;";…
-
1
votes1
answer1962
viewsSQL account how to sum and subtract
I’m starting to learn SQL I need to do an account, I have a select for a report where I need to do an account to show another value in the fields in that report and the formula cannot appear in that…
-
1
votes2
answers757
viewsCreate report displaying total and subtotal
I need to create a PHP report in which information will be searched in Mysql. In Mysql I have a list of billets issued, in which most were paid. In this table(Historico) has the following fields:…
-
1
votes1
answer3131
viewsHow to do Inner Join with Laravel?
I am studying Laravel and I’m not getting it make/understand how to do join and present the data. All students who are in a class with the names, class code and description of the final situation.…
-
1
votes1
answer578
viewsReturn Json with special characters
I am performing a query in the database (Php, Mysql and Ajax), the return of this query is a Json, however all accents are coming with special characters, I put a log to see the result. Below…
-
1
votes2
answers334
viewsMysql query with infinite loop
My 'listing.php' page loops infinitely when displaying values. I used a while to display all database values The PHP code used in the page php listing. <?php while($row = $resultado):?>…
-
1
votes2
answers71
viewsAdding fields between different tables in Mysql
I have the following structure: BUYING id_compra desc_compra valortotal_compra data_compra id_colaborador COMPRAPROD id_compraprod id_compra id_produto qtd_compraprod valorunit_compraprod…
-
1
votes0
answers172
viewsHTML, JS - Creating Form with Subform
I created this java script code to Select State and City with FORM SELECT. What it has is that.. I would like to get the state data, through MYSQL, instead of writing them... How can I do this in…
-
1
votes0
answers88
viewsConnect to the database via browser console
I have a JS application that runs via browser console. I would like to know the possibilities of sending and receiving data via mysql via the Console. I don’t know if it’s possible either. I tried…
-
1
votes1
answer49
viewsDifficulty in 1:n
Hello, I’m having great difficulty in making the relationship a table (clientes) and another (acompanhamento). Come on. I have these 2 tables in my comic book - clients and follow-up. The follow-up…
-
1
votes3
answers963
viewsstore the value of a query in a php variable
I want to save the value of a select to a php variable, and then show it in html. I tried something like: function totalEspumas(){ $banco = abrirBanco(); $quantidade_pedidos = "SELECT…
-
1
votes1
answer100
viewsWhat about the php view.blade.that loads the data into a Carousel bootstrap?
I am trying to load the data dynamically from a mysql database, to a Carousel bootstrap, with Laravel 5.3. The following is happening: The data is loaded, but Carousel does not work, that is, it is…
-
1
votes1
answer867
viewsHow to save data from a checkbox to a MYSQL field
Good night. I have some checkbox fields, I want to save the selected data in only one field in the Database. Part of the form: <div class="form-group"> <label class="col-md-4 control-label"…
-
1
votes0
answers139
viewsMaps Javascript Api - Problem saving searched location in Mysql database
I need that when the user clicks the save button that appears when Mark receives a click, the location information is saved to the database. Hidden fields that receive location values when searched:…
-
1
votes2
answers545
viewsQuery DELETE taking too long to load
I’m having a problem with a query, it has the function of deleting some existing duplicate records in a table. Follows: DELETE t1 FROM bid_account t1 INNER JOIN bid_account t2 WHERE t1.id > t2.id…
-
1
votes2
answers39
viewsInsert only the filled line in php
I have this code: <?php $j=0; while($rows_cursos = mysqli_fetch_array($resultado_cursos)) { $tabela1 .= '<tr>'; $tabela1 .= '<td> <input type="text" size="45" name= "NomeUtente[]"…
-
1
votes0
answers28
viewsProcedure does not run its loop and not from the syntax error
The PROCEDURE below does not present syntax error, but when running LOOP it does not update the records correctly, only a few are updated. CREATE PROCEDURE `SP_ATU_ITEM_NF` () BEGIN DECLARE…
-
1
votes1
answer265
viewsHow to make a Session
I have a system that has a login page, but it only sees if there is that email and password that the user typed in the database and releases to the main page. Now I needed to create a profile page…