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
answer416
viewsHow do I set up a Mysql database that is on my machine to be accessed on the web-hosted Moodle?
I have hired Uol Host hosting services, but I cannot change the database provided by them. I would like to know how to connect a database of my machine to the Moodle that is installed on the host.…
-
1
votes0
answers365
viewsHow to use PHP Objects and Mysql Transaction Control?
I have a database with some tables, and I created a class for manipulation for each table of the bank, an example of them is a class for orders and another for itensPedidos. Each class manipulates…
-
1
votes1
answer62
viewsHow to use DNA?
I wonder where I can put the AND tipregistro = 'mysql' so that when you have !empyt and when you don’t have to bring the tipregistro = 'mysql' this is my query public function…
-
1
votes1
answer449
viewsDoes Mysql work with more than one index?
If I have a query in a table: SELECT * FROM clientes WHERE empresa_id=10 AND datacad='2017-01-01' And two indexes, one in the column 'empresa_id' and another in 'datacad'. Mysql will use only one of…
-
1
votes1
answer133
viewsHow to order query using PDO?
How can I sort my query from the latest to the oldest date. This is my Query ? public function RetornaAtualizacoesFuncionarios($data,$codusuario){ $WHERE = array() ; if( !empty( $codusuario ) )…
-
1
votes3
answers227
viewsMysql sorting by specified value Return all values
Good afternoon, Is there any method in an sql query to sort from a value and if there is this value return it from first and then all the rest of the values ? Example : A table with days from 1 to…
-
1
votes1
answer1275
viewsAllow null value in relationship field
I have a database MySQL with tables t1 and t2. One of the columns in the table t1 has a foreign key to t2. You need to allow the foreign key column to accept values null. Important data already…
-
1
votes2
answers528
viewsHow to show the number records in PDO using COUNT( * )?
Hello I’m doing a system that lists in the database the latest updates , even it’s all right , only I wanted to print in the table the number of total updates that the user did . How can I do that ?…
-
1
votes2
answers611
viewsUpdating multiple Mysql lines and fields
I built a Mysql Query in order to update a field in several rows of my Mysql table. It was as follows: update produtos set (nome) = case codigo when 5 then 'teste 1' when 6 then 'teste 2' when 7…
-
1
votes2
answers130
viewsPHP How do I multiply hours with the amount of times it will be repeated?
I have a table in my Mysql of time products, example: Table Processes id - description - time 01 - Drilling - 0:01:50 Example if I have to manufacture a part that has 5 holes, I have to multiply…
-
1
votes1
answer711
viewsRetrieve JSON values and mount HTML for each record
I’m having doubts about how to structure a JQuery that should append an HTML code to each of the items that a JSON returns to me. My question is how to retrieve each of the JSON values and make a…
-
1
votes1
answer45
viewsBest Type Mysql to count the accesses
I have a database where it contains PDF files, only I’m willing to count how many views this file had. The accounting structure is ready, because it was done in PHP/Mysql, but I have a question.…
mysqlasked 6 years, 8 months ago user24136 -
1
votes1
answer110
viewscheckbox filled with php database data
I have this code that creates the calendar and checkbox: <?php # PHP Calendar (version 2.3), written by Keith Devens function generate_calendar($year, $month, $days = array(), $day_name_length =…
-
1
votes1
answer501
viewsMysql: Limit record recording based on value from another table
I have a table A with a field start_date and another end_date. I have a table B with a field date. Is there any way to ensure that a record is only saved on B when B.date be among A.start_date and…
-
1
votes2
answers46
viewsI cannot store the data in my variable database others2
if(isset($_POST['cadastrar'])){ $categoria = $_POST ['categoria']; $origem = $_POST ['origem']; $acao = $_POST['acoes']; $responsavel = $_POST ['responsavel']; $quando = $_POST ['quando']; $status =…
-
1
votes1
answer435
viewsHow to insert ON DELETE and ON UPDATE
I have a database structure MySQL ready, but the ALTER TABLE of FOREIGN KEY's did not specify settings for ON DELETE and ON UPDATE. How do I enter these settings now, with tables and keys already…
-
1
votes1
answer235
viewsFill combobox, and pick up value menber Vb.net and mysql
I need to fill a combobox with my mysql database, and then take the value menber to enter in the database Att. I’m in need of help from a person who knows visual basic.net , I’m with a system, for a…
-
1
votes1
answer649
viewsQuery in very long delay tables? Mysql
I am developing a system that I hope to become great in the future and I have a dilemma: store an array in each user’s data or create a specific table with all this mixed information (Ex: each…
-
1
votes2
answers245
views -
1
votes2
answers40
viewsError handling hours in mysql
I’m having a problem adding time to a field in mysql. When using the function date_add(Arrival, interval ". $item[6]." minute)... ADDTIME(Arrival,". $item[6].")... Both in a given circumstance,…
-
1
votes2
answers397
viewsSort according to database | PHP
I have the following structure: I have 3 types of classification, following the coherence: 1.0.0, 1.1.0, 1.1.1, 1.1.2 - I have to display in front of the titles, each content that belongs to its…
-
1
votes1
answer49
viewsHow to enter several data received from the same field?
I have a form in html that has a field where the user goes inserting the data as it shows the code below, this form is dynamic and the user can insert as much information as he wants, in the…
-
1
votes2
answers898
viewsHTML/JS/PHP: Transform date entry into dd/mm/yyyy
Good morning. In my mysql database the dates are saved as dd/mm/yyyy, but the "date" html input only returns dates in the yyyy-mm-dd format, so I can’t filter the database dates, which was my goal.…
-
1
votes1
answer281
viewsCAST for monetary value stored in text in Mysql
In the table of products of the bank there is a field valor that has the type varchar(255) Observe the query : Consultation SELECT valor as valor_original, CAST(valor AS DECIMAL(18,2)) as…
-
1
votes2
answers99
viewsHow to introduce polylines in google maps api v3 with dates saved in the database
I am trying to show in google maps api v3 polylines that are stored in my database Here is the connection with the conf.inc.php database : <?php define('HOST','localhost'); define('USER','xxxx');…
-
1
votes1
answer36
viewsProblem in SQL selection
Why even if I filter to return only the fiat manufacturer, keeps returning other values? SELECT FABRICANTE, MODELO, VALOR_DIARIA FROM VEICULO WHERE VALOR_DIARIA = (SELECT MIN(VALOR_DIARIA) FROM…
-
1
votes1
answer3037
viewsError spring boot when connecting to mysql
I created a test project by Spring Tool Suite to create a REST server that will connect with a local mysql database, when I start the application it error when trying to connect with mysql:…
-
1
votes3
answers707
views -
1
votes2
answers907
viewsRedirect after php Action
The customer form, just sent emails, now I need that in addition to send the emails, the data is stored in the database, this I was able to perform, so my html : <form action="insert.php"…
-
1
votes2
answers1212
viewsOnly catch the year of a column in Mysql
I have a query that has a condition, which checks whether the record is greater than or equal to today’s date. He is like that: WHERE t1.bidpack_buy_date => NOW() Well, then he’ll check if the…
-
1
votes0
answers44
viewsDoubt with hierarchical data
Talk, you guys, all right ? I have a problem already have a few days , in the system I need to control the display of some data, I have a function registration , sector and employee, linked between…
-
1
votes2
answers49
viewsDate passed as NULL to the database
I have this structure: //Dia atual + i meses $data_pagamento = "DATE_ADD(CURRENT_TIMESTAMP,INTERVAL ".$i." MONTH)"; $sql = "INSERT INTO pagamento(fk_1, fk_2, fk_3, fk_4, fk_5, preco,…
-
1
votes2
answers66
viewsSQL filter (Result that should not appear)
is the following I am creating an online schedule and need to list the and show the times that are not scheduled, to show the schedules free. And for that I created the schedule_schedules table…
-
1
votes0
answers49
viewsAjax with phpmyadmin
I have a form that records the data in phpmyadmin, but when the data is sent, the page of a Reload for php. I researched on ajax, and I saw that it can help me, but I did not understand very well…
-
1
votes2
answers312
viewsHow to Sort Records After Count
Query SET @ranking = 0; SELECT @ranking := @ranking + 1 AS rank, `empresas`.`id`, `empresas`.`id` AS `id_empresa`, `empresas`.`id_marca`, `slug`, `slug_bairro`, `empresa_logins`.`nome`,…
mysqlasked 8 years, 1 month ago Diego Souza 16,524 -
1
votes1
answer94
viewsGroup continuous repeats with Mysql
I was wondering if there is any way to group repetitions using Mysql only. If you make a SELECT * from tabela WHERE id_usuario = 1 ORDER BY id ASC will return: id | id_usuario | Data | Texto 0 | 1 |…
-
1
votes0
answers83
viewsDoes Ajax only bring results on the console?
Good afternoon guys, I can bring a result in the log, but in the div is not passed on, follows my source: Index.php var teste; $.ajax({ url: 'conversa.php', type: 'GET', success: function(res) {…
-
1
votes2
answers46
viewsTake array data dynamically in PHP
I’m developing a project, in which I need to dynamically take the data that is registered in the database. To read this data, I have this function: // Lê registros function DBRead($table, $params =…
-
1
votes1
answer58
viewsHow to limit display of records according to parameters
I have a problem and the solution I am trying to apply does not seem to me to be the most suitable, I need to show some results of certain products limiting this display, I have the following sql…
-
1
votes1
answer113
viewsAdd value at the beginning and end of a mysql string
How to add text at the beginning and end of a string? For example, I would like to add <p style="display:inline;"> at the beginning and </p> at the end of all rows in the column answer…
-
1
votes1
answer21
viewsUnexpected Error in PDO class
I’m breaking the hook with this code for some time now, it’s the first time I’m using the PDO class of PHP and I’m having an error that I don’t know how to solve. <?php include "conexao.php";…
-
1
votes1
answer36
viewsPost registration error with empty text
The registration code of the post is this: <?php if(isset($_POST['cadastrar'])){ $titulo = trim(strip_tags($_POST['titulo'])); $data = trim(strip_tags($_POST['data'])); $descricao =…
-
1
votes0
answers250
viewsMysql error - request expired
I’m using Mysql, but I’m having to reset the password every time I restart my laptop. I use Sequel pro to access the bank and give the following error: Cannot connect to host 127.0.0.1, or request…
-
1
votes1
answer29
viewsHow to insert data into related tables using PDO
I researched a lot more I found nothing concrete with PDO, hear about this function last_insert_id but I have no idea how to apply.
-
1
votes0
answers114
viewsinsert date in mysql database "ex. day/month/year"
I’m a beginner, I use bd mysql and php, I’m not sure about my database. use the following input: <input type="text" placeholder="Data de início" class="btntarefa" name="dataInicio"…
-
1
votes2
answers60
viewsmysql_num_row with Inner Join
I have 2 tables: Leads Shops The relationship is as follows: 1 store -> N leads I need to list the number of registered leads for each store and then sort in descending order to know which store…
-
1
votes1
answer50
viewsproblems with php, json, javascript and mysql
I’m trying to get data from mysql to display on html with php using json, but this going wrong, it brings the data but does not display, if I hit the F12 it shows the database data but does not…
-
1
votes1
answer86
viewsInclude new table in multiple Mysql databases at once
I don’t know if it would be possible, but we took a system made in PHP/Mysql from which each client has its own database. But we are creating another tool for this system and of course, will have a…
-
1
votes1
answer541
viewsHow to generate random numbers starting from 00000 to 99999 without repetition using Mysql only
How to generate random numbers starting from 00000 to 99999 without repetition using Mysql only, numbers cannot start in 000, anyone has any idea how I can do this?
-
1
votes1
answer84
viewsMysql table with datetime field, how to know how many days have passed?
Hello, I have a table where there are the following fields. prod_id [int 11] prod_nome [varchar 100] prod_desc [textarea] prod_valor [double 10,2] prod_data_cadastro [datetime] I need to create a…