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
answers36
viewsIdentify duplicities and possible duplicities through Scores/ranking
I have a database in mysql that has user information where I have to define what is duplicity or not. Notes: The NOME_MAE and DATA_NASC fields are not mandatory. Examples of records: Just doing the…
-
0
votes1
answer125
viewsQuery two different tables in the same select
I need to perform a search in two different tables and give echo in the results separately! I think it would be something more or less like this: $consulta = "SELECT * FROM tabela1 T1 UNION (SELECT*…
-
0
votes1
answer55
viewsAssociate images to category
I am developing a slideshow based on categories. That is, the categories are pulled from the database and the images are associated with them. However, I am having 2 problems. The first is the…
-
0
votes0
answers781
viewsSQLSTATE[HY000]: General error: 2053 when do I call a Stored Procedure?
I’m using Laravel 4.2 and I’m calling one Stored Procedure of a database on the server. Locally everything works fine, but on the server, using the same BD, gives error. The call is as follows:…
-
0
votes1
answer91
viewsdata field with direct order by in mysql displays a result and php exits differently
I’m trying to display a query ordered by month field date, in the phpmyadmin the query comes out right and when I display the result of the same query with php the date comes out of the correct…
-
0
votes1
answer38
viewsUse Hibernate to save two equal classes
Good afternoon, I’d like to relate the class Partida with class Time, where departure would receive the PK(Id) of the home team and the visiting team. I am doubtful how to relate in both classes,…
-
0
votes0
answers43
viewsHTML form does not work in Data Change
The "Insert" and "delete" forms are interacting with the Mysql database table data. Except The record-manager form that has the function of "Change" record: <%@LANGUAGE="VBSCRIPT"…
-
0
votes2
answers302
viewsHow to query more than one table (Wordpress)
How do I perform a QUERY in the database in 5 different tables and return the values I want, example: I am performing a search system (my first) and need to capture the following values: Candidate…
-
0
votes1
answer21
viewsTrigger executes if a column value is 'Database I'
Create a trigger that automatically enrolls a student in "BD Laboratory I" as soon as it is registered in "Database I". use Universidade; insert into Realiza_matricula (RGAacad, Nomedisc)…
-
0
votes0
answers27
viewsDelete line according to date difference in Mysql
I am trying to delete lines from a table using as a reference the difference between the current date and the date the line was registered. Here is my code: DELETE FROM lixeira WHERE diferenca >…
-
0
votes4
answers79
viewsFind names in 2 different tables
I want to search in 2 tables of the database where the name equals the variable $nome. I would not like to join data as if they were FK, but pull all the information from these tables (other…
-
0
votes2
answers79
viewsMysql query using JOIN
Hello! I have the following database: I would like to make a query where I can search for example the teacher x that is related to the student y and z but not the student w. However when performing…
-
0
votes0
answers191
viewsHow to debug a Mysql query?
Is there any way to know what’s wrong with this QUERY? When you perform a query, it displays it on the screen but nothing appears, the var_dump returns NULL, what steps a professional takes to know…
-
0
votes4
answers131
viewsMAX with LIMIT does not give the correct result
Imagine the following lines in my Mysql database: I want a query that displays the name and age of the person who has the highest age in the table, for that I did this query: SELECT nome, MAX(idade)…
-
0
votes0
answers39
viewsdoubt VIEW Mysql
In a table I have the following columns: nomeAluno, disciplina, numeroDeFaltas. I need a VIEW that I can put the student’s name in the clause WHERE and she returns to me the name of the discipline…
mysqlasked 6 years ago Maycon Guedes 1 -
0
votes2
answers98
viewsRepeat condition in WHERE at the time of query
Currently use WHERE coluna IN (1,2,3,4) in my consultation. Only I realized that the IN works as a kind of "OR", it generates me a small problem, because the ID are features of a product. These…
-
0
votes1
answer3140
viewsHow to change data types in fields in a table in mysql at once
I have the following table: create table pessoas( id tinyint, nome char, peso float, altura float(3), sexo int(1), nacionalidade varchar (20) ); But I want to change all the fields at once alter…
-
0
votes1
answer204
viewsHow do I make a rollback or "undo" button in my application?
Is there any way to recover deleted data from Database? I’m making an application where I have the buttons to add, edit and delete and now I’m thinking about doing another to undo a delete. How can…
-
0
votes1
answer102
viewsError to grab last ID
Hi. I’m having trouble getting the last registered ID. I’ve made a lot of attempts, but the $proximo_ID variable always returns me '0', or Empty. You could help me solve the problem?…
-
0
votes0
answers26
viewsIs it possible to exchange the Index of a database table with the following?
One have a mysql table (tbl_test) that has a unique ID, name string and an int order. ID | Nome | Ordem 1 | name1 | 1 2 | name2 | 4 3 | name3 | 3 4 | name4 | 5 5 | name5 | 2 I wonder if it is…
-
0
votes0
answers34
viewsI have a select file on 4 pages in 1 of them works and the other three does not answer the query
function recuperaRacas($idAnimal) { $idAnimal = strip_tags($idAnimal); $query = "select raca_id 'idRaca', raca 'raca' from raca_nimal where id_nimal = " .$idAnimal. " order by raca;";…
-
0
votes1
answer445
viewsView Mysql Related Tables Query
I have found some answers on the subject, but I still have some doubts, I will try to be as clear as possible. My Example of Banking. have the following tables Table Customer> id | name| request…
-
0
votes0
answers36
viewsMysql does not return timediff value
Good afternoon, I’m riding a Rigger in which I need to return the difference between two Datetimes. I’m trying to use the code below, but mysql does not return anything. If I run Select directly it…
-
0
votes1
answer54
viewsMysql Error 1064
in the Insert below I get the following error. INSERT INTO dump1090 ('hex','squawk','flight','lat','lon','validposition','altitude','vert_rate','track','validtrack','speed','messages','seen') VALUES…
-
0
votes1
answer80
viewsError variable stmt of type Statement
I’m trying to run the table, but in netbeans it keeps alerting the error in the Executequery line. Symbol: method executeQuery(String) Location: variable stmt of type Statement The error is…
-
0
votes1
answer484
viewsMYSQL numeric alpha code
I want a code INTERNALLY in Mysql a random code, with 2 letters,1 number, 1 letter, 2 numbers AB-1A-21 - DA-2B-35 - CI-3U-23 how to proceed ?
-
0
votes1
answer26
viewsGroup By show when not in the table
I have the table below in Mysql: I wanted to search the users that has the color BLUE but does not have the color GREEN, IE, in this table would list me user 3 only, I tried so: SELECT * FROM…
-
0
votes0
answers40
viewsConcatenation OR, AND, ORDER BY and RAND() do not work
I’m with the following SQL: SELECT id,titulo,slug,endereco FROM empresas WHERE (categoria = ".$_GET['id']." OR categoria_2 = ".$_GET['id']." OR categoria_3 = ".$_GET['id'].") AND (status = '1')…
-
0
votes2
answers42
viewsMy query that used to work, now does not go to bd at all
Out of the blue my querys are no longer accepted by my BD. That’s both by the site in php and direct with an INSERT in phpmyadmin. See if you can shed a light: CREATE TABLE `despesas` ( `id` int(11)…
-
0
votes2
answers147
viewsuse of mysqli_prepare prevents major sql Injection attacks
I know that mysqli_prepare shutdown is used to prepare SQL queries and protect them against SQL Injection. I found two pages about SQL Injection:…
-
0
votes2
answers543
viewsPick up data using Join in two table 1 for many
good morning, I need to perform a select of two tables that are related 1 to many: Table 1: products Table 2: price group I need to get all prices from the price group table, which may have 1 or…
-
0
votes1
answer179
viewsDynamic form in PHP and Mysql
need a dynamic form that operates as follows: The page should generate Y textboxes according to a Y number in the bank. My reasoning is this:: a. I select in the bank to see the number b. I do a…
-
0
votes1
answer126
viewsButton running one function in js and another in php
Good afternoon guys, I’m having a doubt would have as soon as I clicked on the button it called a function in js and another in php? I have a problem I want a variable in case $name receives the…
-
0
votes1
answer164
viewsSave fields back to python variables
I made a query in mysql with python and show the result: cursor = db.cursor() cursor.execute("SELECT Dias, HoraConsulta, HoraSaida, nome, Consulta, centrodb.LocalConsulta.Descricao, Contato FROM…
-
0
votes1
answer68
viewsProblem with HTML special character identification
I’m having some problems in identifying special characters from the database. I decode in UTF-8 in the database: ALTER DATABASE meuBanco CHARACTER SET utf8 COLLATE utf8_unicode_ci; And also in HTML:…
-
0
votes0
answers34
viewsListing does not complete all lines
I have a problem when it comes to making a list. There are hours that normal list and there are hours that does not show all lines In this image above shows 7 lines more would have to show 15. the…
-
0
votes2
answers4266
viewsLaravel Insert data into a table and use the same id to fill another
I am starting in Laravel and I have a problem related to inserting data in two tables of mysql... explaining better would be the following: I have a table called questionnaires where I have only ID…
-
0
votes1
answer282
viewsForeach multiplying results coming from the database (PHP/Wordpress)
How to do for foreach do not multiply the results coming from the database? I have the following function: $categoriess = (array) get_terms( 'job_category', array('hide_empty'=>false) ); echo…
-
0
votes1
answer25
viewsHow do I change my root password in windows?
i lost the root password I put in when I installed Mysql, but I don’t know how to reset/change without knowing the password
-
0
votes2
answers500
viewsDisplay higher value and name
I have the following code: <?php $consulta = mysql_fetch_assoc(mysql_query('SELECT MAX(pontos) FROM usuarios')); echo intval($consulta['MAX(pontos)']); ?> However, it only displays the highest…
-
0
votes0
answers74
viewsUpdate with PHP and MYSQL division
How do I make a UPDATE for all users of a database? For example: UPDATE usuarios SET juros=investimento + investimento * 30 /100 WHERE id='89' The bank will take the investment data and add 30%, but…
-
0
votes0
answers22
viewsTriger after update as a solution to debit credits safely
I need to make an interface that guarantees the integrity of the customer’s credit. In PHP, when we use LOCK explicitly in PDO, with LOCK TABLES, when dealing there may be inconsistency, when the…
-
0
votes0
answers242
viewsInsert sql with WHERE NOT EXISTS rule does not work
In this Sert below only works until the first rule of "Where" then no longer works Example WHERE descricao ='$ccusto' // funciona perfeitamente. Mas se uso o where abaixo WHERE descricao ='$ccusto'…
-
0
votes1
answer48
viewsHow to get from last record to first
I have these names on my chart: nome ----- A B C D E F If I do: SELECT nome FROM tabela he will return me "A, B, C, D, E, F". I’d like you to return me backwards, from the last record to the first.…
-
0
votes1
answer48
viewsProblem with php code to send simultaneous messages to the database!
I’m trying to create a code covers send messages between users of a system in php, the problem and I can send the message from one user to another but wish it was possible to send to all users, or…
-
0
votes1
answer43
viewsImplement 2 search criteria in the query (Wodpress/Mysql)
Within this query how do I add 2 more search criteria $wpdb->postmeta.meta_key = '_viewable' and $wpdb->postmeta.meta_value = 'yes'? $query10 = $wpdb->get_results(" SELECT * FROM…
-
0
votes1
answer72
viewsError when displaying bank return in Mysqli
Guys, I’m doing a PDO login system I don’t understand much, but I’m going through this problem, I developed the following code below: $select = $con -> prepare("SELECT * FROM conta WHERE conta =…
-
0
votes1
answer40
viewsInsert only if date is not duplicated - Python
Good afternoon, you guys! Today I am making an Internet that does not check if such record has already been entered in the database. Through the variables: name, date and number an Index is…
-
0
votes2
answers284
viewsSelect with two conditions
How do I select users who have code other than 0 and 573? For example, this is my table: Usuario Codigo 1 573 2 0 3 0 4 100 5 520 I need to select only users who have the code DIFFERENT from 0 and…
mysqlasked 5 years, 11 months ago user134546 51 -
0
votes0
answers47
viewsApply rates according to the number of books sold
I have the following problem: A publisher pays x% to the author and it has several levels. If the author sells up to 1000unid books he receives 10% of the sale. Between 1000unid and 5000unid…