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
-
2
votes1
answer36
viewsHow to leave the date in this format 27-Feb-17 at 21:52
quick thing I need to know how I leave the date in this format 27-Feb-17 at 21:52 my code is this <?php echo date('d/m/Y H:i', $news['published']); ?>
-
2
votes1
answer143
viewsSelect with LIKE and POST
Hello I’m trying to use a LIKE in a SELECT, the data turned via GET, but it doesn’t work, which may be wrong ? $nome = $_GET['nome']; $row=$db->prepare("SELECT * FROM cadastro WHERE nome LIKE…
-
2
votes1
answer147
viewsScheduled tasks in PHP
I have a database with information about books and loans of the same, when the time the book can be borrowed expires then the system must change the status of the loan record. I thought to do this…
-
2
votes2
answers1770
viewsHow to force a drop table into SQL?
While trying to give a drop table in a table that has relationships, the following error occurs: #1451 - Não pode apagar uma linha pai: uma restrição de chave estrangeira falhou Is there any way to…
-
2
votes1
answer1170
views"Syntax error: Missing 'semicolon'" in Mysql database
I have the procedure down below CREATE DEFINER=`root`@`localhost` PROCEDURE `SP_notasAluno`(IN aluno INT) BEGIN DECLARE ditCodigo,courseId INT; DECLARE usuario VARCHAR(50); DECLARE…
-
2
votes1
answer149
viewsHow to save data from various Mysql queries?
I have a table with data of various metals and I need to take this data to use on my page, but I’m not getting to pick all, only the first works. Code: $link = mysqli_connect("localhost", "root",…
-
2
votes3
answers497
viewsError Search PHP and Mysql Database
I’m making a page that searches for information in tables of a Mysql database, the connection is beautiful, but is showing two errors : Warning: mysqli_stmt::bind_param(): Number of variables…
-
2
votes1
answer416
viewsPHP find addresses up to 5km away
Hello. I’m mounting a system to find the nearest service provider to the zip code. For this I used the script below to convert cep in coordinate. $cep = "01238010"; $geocode =…
-
2
votes1
answer367
viewsMysql - Foreign key in ON DELETE NO ACTION but runs ON DELETE CASCADE
I’m developing a system using Apache, Hibernate e MySQL. But I’m having a problem during the exclusion of parent entries from a foreign key. The database should prevent deletion, but delete the…
-
2
votes2
answers398
viewsHow to write data from two columns of a table using select?
Hello, I am using a Select to take data from the Marks table, and save the code and brand name when registering the product, but I am not able to save the data of both simultaneously, I can only…
-
2
votes3
answers945
viewsProblem with php query because of quotation marks
I’m having trouble with a php query as follows, Example: INSERT INTO Customers (CustomerName, ContactName, Address, City, PostalCode, Country) VALUES ('Cardinal','Tom B. Erichsen','Skagen…
-
2
votes2
answers261
viewsUpdate with character in the middle of the string
I have thousands of records with a code in a very peculiar format that identifies boxes on streetlights. Ex.: 21.305-005/100a However, this code is currently in 21305005100-A format. As the position…
mysqlasked 7 years, 5 months ago Rafael Silva 141 -
2
votes2
answers298
viewsProhibit duplicate emails in Mysql using PHP
My situation is as follows, I have an email marketing system all in PHP and emails are added per file. CSV, but it is adding duplicate values and blank values. The problem is that, i have 1 table…
-
2
votes1
answer2986
viewsGroup two fields in the same table with mysql
I’m trying to put together a query, where I can print out the broker’s name and the sales percentage for it. When grouped by name1, the field name_broker2 does not group and vice versa, when grouped…
-
2
votes1
answer2066
viewsMysql does not install
I am trying to install Mysql on Windows 10 and Microsoft Visual C++ 2013 is requested as a requirement. I have the latest version of Visual Studio installed and as a consequence were installed also…
-
2
votes2
answers5284
viewsHow to do Inner Join in mysql?
I have 2 tables in my database, Categories and Cars. The table categories has a PK Id_category and Name. Already Automobiles has a PK Id_automoveis and the other columns that make up this table…
-
2
votes1
answer3699
viewsHow the Insert would look in a table that only has a foreign key
I have a user registration and this registration can be done in two ways, by facebook or by email. My question would be how to give the Insert in these tables, because I have a control table that…
-
2
votes1
answer337
viewsCount rows that have the same value in 2 different columns?
Table ID jogada pontos 1 1 3 1 1 1 2 5 1 2 5 1 2 5 3 2 5 3 I wanted to create a query that COUNTS the playing lines and ADDS the total of points, but that indicates the sum by repeating the "ID"…
-
2
votes1
answer822
viewsUpdate in more than one line
I’m trying to ride a update thus: UPDATE cad_vendas SET canal ='9', parceiro ='9' WHERE cpf_vendedor ='CPF_VENDEDOR' and status_proposta_producao ='90' and forma_pagamento <> ''; but he won’t…
-
2
votes1
answer2448
viewsMysql display the sum field with null value
I’ve researched but I can’t find what I need. I have a chart where I have a record of debt and credit releases. These values are in the 'value' field. But I want to display this field in two…
-
2
votes1
answer246
viewsHow to list Mysql results in the listview
Structure of the Code In this function below I try to grab the contents of the Mysql database and passing to a List<BDependente> lDep on the line where this facade.listDependente(bDep);…
-
2
votes1
answer942
viewsHow to save a localdate to a mysql table?
I have a table book that has a column like "Date" and in my java code I have a field like "localdate". I need to save the data from the "Localdate" field in the table but I’m finding it difficult to…
-
2
votes2
answers150
viewsUse one if with two selects
I am doing a query, in which the second query can give "NULL" or a value (if there is data). SELECT *, (SELECT tb1.image FROM ce_users_images tb1 WHERE tb1.iduser = users.iduser LIMIT 1) AS tmp1…
-
2
votes1
answer580
viewsDatetime attribute error in C# saving to Mysql
I am trying to enter in the Mysql database the date of birth of the user, in C# the attribute data_birth is of type DateTime and in Mysql the attribute data_nascimento is of type Date, to insert C#…
-
2
votes2
answers4463
viewsSum in sql update
I am running the following sql on my mysql: UPDATE `cadastro` SET `pontos`= 'pontos + 1' WHERE id = 102; I need it every time it is Update in the table register the field dots who’s kind int(11)…
mysqlasked 7 years, 5 months ago Hugo Borges 5,294 -
2
votes1
answer816
viewsUpdate Trigger in Mysql
I don’t know much about Mysql and need to make a Trigger to update a line right after its insertion. When the user registers an order he selects how many orders he wants. In the database is saved in…
-
2
votes2
answers472
viewsHow to make one-to-many foreign keys using PHP
I have a table with 3 columns: noticias | categorias | tags ----------------------------------------------- id | id | tag_a noticia_nome | tag_nome | tag_b noticia_id | | ... | | tag_j (10 no total)…
-
2
votes1
answer47
viewsAnother form of UPDATE?
I am doing a Mysql class work and would like to know another form of UPDATE, because this is not changing. Update the price of service of all animals that received bath in the pet shop and had less…
mysqlasked 7 years, 4 months ago Andrews Y Fernanda 29 -
2
votes1
answer156
viewsCan index in an ENUM field bring any advantage?
I was reading in a reply from Soen, that the fields of a table that have INDEX can optimize a query. Of course, as long as this query is known, such as a user survey by the email, for example. I…
-
2
votes2
answers1258
viewsCount values with specific data in MYSQL
I have a huge list of values that I need to count, the example is, I have 4000 barcodes and those 4000, 2000 are marked in the column out of stock with a yes. Better explanations In total barcode…
-
2
votes1
answer139
viewsSort results with month and year
I have a table with the fields mes E ano. How can I sort the results according to the month. I’m already ordering according to the year => SELECT * FROM tabela WHERE id_cliente = '$id_cliente'…
-
2
votes2
answers1036
viewsUPDATE in two PHP tables
In my database I have a table called register id_cadastro name_user email_user idade_user overuser fb_user tt_user in_user avatar_user This is the information I use for logging in. However, after…
-
2
votes2
answers124
viewsGet more SQL-rated records
I have two tables: comentarios ---id ---comentario ---usuario ---supermercado ---avaliacao supermercado ---id ---nome ---endereco ---admin I want to take the average of ratings from each supermarket…
-
2
votes2
answers967
viewsAdd and split results in the same query
How do I fix this situation? $q = mysql_query("SELECT *, COUNT(*) as total, SUM(bolas_agarradas+bolas_espalmadas) as defesas, SUM(bolas_agarradas+bolas_espalmadas+gols_sofridos) as chances,…
-
2
votes1
answer40
viewsCount only new regsitros at the bank and submit as notifications
I have the following question, I need to return in a panel that there are records that are not being shown on the screen. Type I have 10 records being displayed, are registered 2 more so I need to…
-
2
votes1
answer332
viewsQuery with variable date in Mysql returning empty
I need to make a query in Mysql setting 3 variables,when only in the case of right integer,more when I include empty return date ta. Follows my query,what could be doing wrong? SET @tipo = 47; SET…
-
2
votes2
answers334
viewsform read database
Hello Folks I am trying to make a form read Mysql database options, however the code line below shows me only the word "Array". What is my mistake in this line? Can anyone help me. <form…
-
2
votes3
answers1305
viewsList records that are in a table and those that are not in the same table
I have a points table and a users table. At points, I have an ID that references the users table user. What I need to do is return all users who have hit the point, along with those who haven’t hit…
-
2
votes2
answers2006
views -
2
votes4
answers2768
viewsHow do I enter a value in every record in a column of a table?
I have the table 'category' and a column 'id', and this column has more than 100 records. How do I add a value to all these records? In case the value would be '3'.
-
2
votes6
answers2011
viewsHibernate is not creating the tables
I am new to the subject Hibernate, for the little I have learned, I believe I did everything right, ie, I lowered the dependencies, I wrote down the classes, etc. Below follows my class example:…
-
2
votes2
answers5191
viewsHTML and SQL connection
I’m designing a database where I have a table with calculated data indices from other tables. I am also designing an HTML Dashboard to expose these indexes. My database is stored on a Mysql server.…
-
2
votes1
answer665
viewsServer-to-server Mysql Database Synchronization (VPS)
I would like to synchronize my databases that are hosted between 3 different VPS, I would like to synchronize this data in real time when a record is changed in a database in a given VPS…
-
2
votes1
answer245
viewsSelect to bring specific id record
I wonder how do I bring a specific record of a fk, being that I have the table lodging and the table consumption (with fk codHospedagem). When I select some hosting, I click on the consumption…
-
2
votes3
answers2538
viewsMysql query and case distinguish
I wish my login.php check if the password has uppercase, because when it exists, it recognizes, because I have my database with the collation utf8_general_ci. I already tried to put the collation on…
-
2
votes1
answer595
viewsError during DELETE: You can’t specify target table '...' for update in FROM clause
I’m trying to delete data (where the stock is equal to zero and the discount value is less than the total discount value average) with this query: DELETE FROM veiculo WHERE estoquetotal = 0 AND…
-
2
votes1
answer529
viewsMysql SHOW COLUMNS
It would have to bring only the columns of the bank and order of the form that I want for example: show columns FROM table The above code brings up all table columns. bring the ordered columns. SHOW…
-
2
votes1
answer168
viewsHow to take the events of a drag and move to php variables
I have this project below. In it I have a list of images where I can drag and bury as I need. So far it’s working properly the way I need it. I need to consider the position of the images as an…
-
2
votes2
answers116
viewsInvalid argument foreach() return empty message
<table border="1"> <?php foreach($arrayReturn['qsa'] as $value){ ?> <tr> <td>NOME:</td> <td><?=$value['qual'];?></td>…
-
2
votes3
answers558
viewsList Categories with Subcategories of the same table with another table
List Categories with Subcategories of the same table with another table I have the following tables: So far I believe the modeling is ok, right? Then in the result I would like to search the…