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
-
0
votes0
answers65
viewsGenerate query to display Mysql data in php
The bank was created as follows: Each Discipline can have 1 or more classes, while each Class belongs to only 1 discipline. Each Teacher can have 1 or more classes, while each Class belongs to only…
-
0
votes1
answer34
viewsSplit search term to enlarge results and sort results according to the term
Let’s say I have a table called carros. In this table I have some registered cars. Ex: ID | Name 1 | Corsa Amarelo 2 | Camaro 2 Portas Amarelo 3 | Camaro V12 Amarelo 4 | Camaro Esportivo Amarelo 5 |…
-
0
votes0
answers198
viewsAndroid Mysql Connection - Error with POST Method
Good night! I am developing a simple interface in Android Studio to login and register users. I followed the steps of a tutorial on youtube and almost everything works perfectly, I’m just having…
-
0
votes0
answers22
viewsDon’t put all the content of a post at the beginning of the site
I’m making a site posts... and I’m having difficulties to set up how many letters can have at the beginning of my site... because the button itself I already have but I wonder how can "Set" up how…
-
0
votes2
answers224
viewsMysql Query does not work with many arguments
I would like to request assistance from you identifying why my update query does not work. I have the following problem, the query below works normally: $conn->query("UPDATE dados_cadastrais SET…
-
0
votes1
answer184
viewsAdding 5 variables instead of one! PHP/MYSQL
Hello, I’m having a problem in my conditions(if). Note that I am very new to php/mysql, so this is the reason why possibly my codico is a mess, but it is possible to understand it. <?php…
-
0
votes0
answers18
viewsMYSQL - Is there an alternative to LIMIT in the Queries?
I’m using MYSQL. I have the following table: create table visita ( id int, titulo_socio varchar(10), data_visita date, cidade_visitada varchar(50), status_visitacao varchar(50) ); A data example for…
-
0
votes1
answer70
viewsHow do I subtract and display the result in the MYSQL query
I have 3 tables Vehicles idVeiculo | Placa | Prefixo oleomotor idMotor | idVeiculo | datatroca | kmtroca | horimetroca | proximatroca |idMecanico I already have this query below that shows the…
-
0
votes1
answer56
viewsCodeigniter - Retrieve bank categories
I have a table ''category'' in the database and it has the column 'id' and 'title', I am recovering the same in several menu’s dropdown, but loads all categories of the database but I would like to…
-
0
votes1
answer221
viewsHow to Subtract MYSQL
How to do the correct subtraction of these two columns in the SQL script? SELECT DISTINCT b.prefixo as idVeiculo, max(datatroca) as datatroca, max(kmtroca) as kmtroca, max(horimetroca) as…
-
0
votes1
answer22
viewsReturn values if any record does not exist
I have the tables: tabelaUm [id] [nome] 1 nome1 2 nome2 tabelaDois [id] [idTabelaUm] [nome] 1 1 nome1 1 1 nome2 1 1 nome3 1 2 nome4 1 2 nome5 1 2 nome6 My query: SELECT t1.nome AS n1, t2.nome AS n2…
-
0
votes2
answers55
viewsGive an input in a table with information from two tables
I would like to know how to insert in a table ids of two other tables. For example, there are 5 tables one is student, which has the following information: +--------+------------+ | ID_ALU | nome |…
-
0
votes0
answers50
viewsImpact using INDEXES in Mysql
I have a table that currently has 25 million records, due to this any query I do however simple it is becomes very slow. I was researching about INDICES to improve search performance and found that…
-
0
votes1
answer461
viewsSays it saves to mysql but not saved to the database
Form: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>…
-
0
votes1
answer106
viewsSelect php and connection to the Beginner database
I have a big problem.. I’m a beginner with Php, I’ve researched a lot but I can’t go on. You’re making that mistake Uncaught Error: Call to a Member Function mysqli_fetch_array() on Boolean in C:…
-
0
votes2
answers2939
viewsHow to change from mysql_real_escape_string to mysqli_real_escape_string();?
I am creating a simple php login page based on in this video. However, after doing exactly as the video describes, I learned that my PHP version has updated and it is no longer possible to use the…
-
0
votes1
answer41
viewsList column of one table with all records of another
I have 2 tables, posts and posts_images, the table post owns the fields id, title, Category, and images, and the table posts_images possesses: post_id, img_url etc. I would like to relate the field…
-
0
votes1
answer146
viewsHow to exchange content without changing the structure?
I started making a website in the code anyway. Only this site will have several pages where on every page, the structure is the same, what changes is only the content. In order not to have to do the…
-
0
votes0
answers25
viewsDatabase does not receive querys by php script although it works
Guys with a problem in receiving the form in the database, it seems that although the script is correct it simply ignores it, using xampp, tried by Cloud9 also and the same thing happens. <?php…
-
0
votes0
answers72
viewsSaving PHP and HTML data
Next, I have a form here when filling it I use PHP to validate the data and save in the Mysql database. However, I enter the normal date and when viewing the table of the saved data, the date is the…
-
0
votes1
answer35
viewsPDO eliminates SQL field duplicity
Good guys, I’m using PDO to run my querys. SQL: SELECT Pessoa.IdPessoa, Pessoa.IdPessoa, Pessoa.Nome AS 'Nome', Pessoa.DataNascimento AS 'Nascimento' FROM Pessoa WHERE Pessoa.EstadoCivil = '1' when…
-
0
votes1
answer29
viewsSubselect without condition WHERE
I need to do a list with sub select, and even managed to do it using a condition, however, I need it to occur without condition with the condition would look something like this: SELECT *,(SELECT…
-
0
votes1
answer133
viewsCatch record with JDBC SQL specification
Hello, good afternoon, sir. I’m having to develop a Java system with Mysql. It’s simple, just the part of the backend, but I’m inciante and had not run querys with java before hehe. The system is…
-
0
votes0
answers212
viewsSubmit query on the same page of the form
I’m running a web application for a "Shared Races" (Uber type) service, where I want a CPF query to be presented on the green card. I want when I see the CPF, present on the green card, without…
-
0
votes1
answer46
viewsQuery zeroing column when applying order by - Mysql
I am with a query that when ordering it in ASC it Zera a column of my table, but if I sort in DESC displays the values normally. This is the query: SELECT `tab_medicamentos`.`id`,…
-
0
votes2
answers196
viewsError: Notice: Undefined index || PHP || MYSQL ||
Hi I’m developing a filter for an online store and I’m getting this error when I start the page, But when I click on the continue button of the form, everyone disappears except this: Here is the…
-
0
votes1
answer289
viewsTrigger with sum between dates
Good evening, I need a help I’m not getting, I have two tables in my db. 1 - Portfolio table composed of: CREATE TABLE `carteira` ( `id` int(11) NOT NULL, `datat` datetime DEFAULT NULL, `vl_cliente`…
-
0
votes0
answers72
viewsHow to create function to "change" and "delete"?
I have a table where displays the "data" already registered, and for each data has the option "edit" and "delete". Now I am in doubt how to delete and change the chosen data. I would need a specific…
-
0
votes1
answer51
viewsquery using Case when
Can anyone help me with this query please? I’m having difficulties in organizing this 'Case when' I believe CREDITO | CONTA | TIPO 100 8 ENTRADA 30 9 ENTRADA 30 10 ENTRADA 1 8 SAIDA 10 11 ENTRADA 1…
mysqlasked 6 years, 11 months ago user98426 -
0
votes1
answer58
viewsDatabase does not accept single quote ' when sending
I have a small problem where if in the form I type only a quote ' it does not add in the database. Could someone tell me why and how I could solve this? OBS¹: only with a quote, if I close it with…
-
0
votes2
answers30
viewsMysql Help to Return Unavailable Days for Scheduling
I have 2 mysql tables that represent days unavailable for scheduling: Table Holidays: id, day (date), name Table special_days: id, day (date), will_work(Boolean) In the querie I need to select the…
-
0
votes1
answer64
viewsJunction of Laravel searches
I have the function in my controller: public function pesquisa(Request $request) { if (! Gate::allows('celular')) { return abort(401); } $marcas = CelularMarca::orderBy('nome',…
-
0
votes1
answer188
viewsHow to use 'limit' inside a MYSQL database
Talk about beauty? Next, I am mounting a precedent, where I insert as parameter the number of lines that it will return and if it is 0 or is empty, it returns all possible lines, but in my logic is…
-
0
votes1
answer100
viewsLoop to show all news
I’m trying to make a backoffice for my website so I can publish news! Does anyone know how to loop to show each of the Rows in my database? Thanks to those who help! Note: I’m new to PHP and Mysql…
-
0
votes1
answer68
viewsError between account in 2 tables
Sorry I wouldn’t experience in Latin, I’m starting the studies and need to consult a Mysql table according to the value of another table ex.: Tabela Sessões | id | nome | | 1 | João | | 2 | Fabio |…
-
0
votes1
answer43
viewsQuery Mysql returning differently
I have the following Query: select MONTHNAME(ta2.change_time) as mes, MONTH(ta2.change_time) as numeroMes, case when s2.name like '%Servidores' then cast(SUM(ta2.time_unit) as UNSIGNED) * 1.5 else…
-
0
votes1
answer236
viewsUPLOAD files via php and mysql
I am trying to make a database for personal use that is to upload boleto and then voucher, but I do not know what I am doing wrong because in Mysql there is only a binary file and not the photo or…
-
0
votes0
answers98
viewsShow when no search result in database
In the SQL search, if you do not return the result, you will see a "No results found" message. Okay, when you search, you find a result and when you don’t have it shows the message - so far so good.…
-
0
votes2
answers234
viewsMy PHP not saved in BD
The BD connection has been successfully established. If I play the same Query in Phpmyadmmin the command works and the data is saved in the BD. But if I use the same command in PHP it simply won’t…
-
0
votes1
answer34
viewsError query update set
To $query1 and $query2 work, but the $query1a update is not setting, can anyone tell if it is syntax error? $conexao = mysqli_connect('localhost','rr','4ai','rr') or die('Erro ao conectar ao banco…
-
0
votes1
answer164
viewsError Code: 1215. Cannot add Foreign key Constraint/ Error to add foreign key
I’m trying to create a table called Disciplina, however I am not getting on account of foreign keys. I’ve checked it over and over and I can’t identify the mistake, if you can help me, I’d…
mysqlasked 6 years, 11 months ago Costa.Gustavo 249 -
0
votes0
answers62
viewsPlace ID in foreign key table
'Cause I can’t get the ID on my table foreign key last_insert_id() returning "0" <html> <head> <meta http-equiv="content-Type" content="text/html"; charset="utf-8" />…
-
0
votes0
answers38
viewspass value to php variable
I have this code: var $login = $("input[name='usuario']"); var dadosajax = { 'cod': elemento.value, 'login': $login.val(), }; pageurl = 'salvar_dados_usuarios.php'; $.ajax({ //url da pagina url:…
-
0
votes0
answers120
viewsTrigger creates duplicate records
Mysql "update" Trigger creates 8 records each update. The first record is the old one, the next seven are copies of the change. As I leave only the old and the edited? I tried to put UNIQUE key on…
-
0
votes1
answer107
viewsMysql Process Error
I’m trying to create a procedure but I’m getting errors, after a few attempts, I managed to solve some problems, but I’m not getting more. When trying to create me generates error > ERROR 1064…
-
0
votes1
answer37
views -
0
votes1
answer116
viewsDisplay a record by quantity and the most repeated value of a column
Hello, I have the following problem: I need to display the localities, the number of shipments of each one (ie how often the name of the locality appears in the column) and the most common disease…
-
0
votes1
answer413
viewsC# CRUD - Insert Error (Cannot add or update a Child Row: a Foreign key Constraint fails...)
Good morning, I had managed to do everything right up to this error by inserting something into the database. localhost/phpmyadmin - xampp. It’s something with the id_user but I don’t know what it…
-
0
votes2
answers151
viewsIs it possible to insert and remove at the same time on the same php page?
Good, at the moment I’m doing a project with html, php and mysql and I’m having a little problem now. Getting to the point: Assuming I have two tables: unconfirmed and confirmed, and what I want is,…
-
0
votes1
answer240
viewsRegistering form data with inputs of equal PHP names
I find myself at: implement a form has several inputs with the same name I need to enter the data into the database I intend at the moment: create a record for each user of the platform the form has…