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
votes0
answers438
viewsError Inserting: Incorrect integer value 'EXAMPLE' for column 'id_example' at Row 1
I am trying to insert into my mysql database through Visual Studio 2017 - C# (localhost-wamppserver) but it is giving error. The first column of the table records is the id_record which is the…
-
1
votes0
answers30
viewsGoogle Chart - Treemap does not appear
Hello, I’m trying to plot a treemap with data from a BD (mysql), however, nothing appears. I have tried several alternatives and unsuccessfully. I have been able to plot several graphs, except…
-
1
votes2
answers485
viewsCreate a temporary table or run a 4 table Join with some more fields than others
I have five tables, cis with the fields id, id_referencia, tipoci and numci, the others are cigeral, ciintercambio, cihoraextra and cicompensacao. When I create one of the cis give a insert in the…
-
1
votes0
answers32
viewsConsult execution time of instructions conducted at the Bank
I’m doing a performance analysis job where I did a js script that performs the following steps: 1: run 1000 Inserts after 2000 and so on. 2: I update 500 Inserts after 1000, among other CRUD…
-
1
votes1
answer176
viewsFatal error: Call to Undefined method mysqli_stmt::bindparam() PHP || MYSQL
I’m with this error a few days ago, I’ve seen similar answers here on the site and also in the community in English, but I can not find the appropriate response to my situation. Fatal error: Call to…
-
1
votes1
answer39
viewsProblems with SQL x PHP enconding
I have the following problem: My files are coming out with accentuation problems, my tables use utf-8 as encondig, html files are marked utf-8 and even so accents do not work: <html>…
-
1
votes1
answer65
viewsGroup dates that are in Mysql in PHP
I have a Mysql table called apartamento_data, in it there are dates that the apartment is rented, ie unavailable for rent. Each line a date, so: 2017-05-31 2017-06-01 2017-06-04 2017-06-05…
-
1
votes1
answer34
viewsIdentify type of operation with javascript
How can I identify, when the click is "From:" "To:"? I have a code to add a value from a database field, to another field, follow the example: HTML: <div class='row justify-content-center'>…
-
1
votes1
answer91
viewsSum return of select
I have the following query: SELECT (case when day(sysdate()) < 10 and meses.mes = month(sysdate()) then 0 else CAST(SUM(CASE WHEN s2.name LIKE '%Servidores' THEN ( coalesce(ta.time_unit,0) *…
-
1
votes2
answers108
viewsAccount with received data and mysql data
Good afternoon, it is the following in my project I need to do an account so at the end have the result for the customer know how much to pay, but I am not able to do this account. In my case, I ask…
-
1
votes1
answer578
viewsORDER BY or LIMIT. What is processed first in SQL Select?
Friends, what is first processed in SQL Select? "Order by" or "Limit"? For example, if I have a table with cities of several states. Then I search the cities with more than 100 thousand inhabitants…
-
1
votes1
answer114
viewsMYSQL - Latest results when grouped by a certain field
I have the following tables in my MYSQL database USERS table id | login --------------- 1 | usuario1 2 | usuario2 3 | usuario3 Status table id | idUsuario | data | status 1 | 1 | 2018-05-10 10:00:00…
-
1
votes0
answers126
viewsIs it worth using index for table in Mysql that stores chat messages?
Friends, I read several posts about the use of the index in the tables of the Mysql database, its advantages and disadvantages, but I still had a question for my situation. Consider over 300,000…
-
1
votes0
answers31
viewsGenerate a Generic String with two table data - Codeigniter PHP
I’m in a little trouble. I am developing a system for learning, but one of the requirements that I "invented" myself is to generate a base string. I will try to detail. Tenho a tabela **term** com…
-
1
votes1
answer68
viewsMaximum width and height validation with PHP
I am uploading an image directly to a database but want to check its width and height and if it is not between (X,X) width and (X,X) height does not insert the data into the database and shows an…
-
1
votes1
answer641
views -
1
votes1
answer34
viewsQuery the database using ORDER BY kills my search
My code displays a list of people and a search field at the top. everything works normal, including the search. But I need people to show up at random. The problem is that when I use ORDER BY Rand()…
-
1
votes2
answers567
viewsInsert array into a database using PHP
On the site I’m creating I have a form where people can add various topics. My problem is at the moment where a second or more topics is created because only the first one goes to the bank and I…
-
1
votes0
answers148
viewsHow to update data from another table using a Trigger
I am trying to register a product in a cart, every time it is registered la significa q was purchased, so whenever this happens I want to decrease the amount in stock, tried with Trigger below, but…
-
1
votes2
answers565
viewsAdd multiple products to a single mysql order
Good afternoon I have two tables encomenda and prod_encomenda. My goal is to assign to one order several products. Both contain the id_encomenda, so I guess the structure of the tables is well done!…
-
1
votes1
answer577
viewsI’m trying to create a Mysql Trigger but is giving syntax error
CREATE TRIGGER comissao ON tb_Pedido FOR INSERT, UPDATE, DELETE AS BEGIN DECLARE v_codFuncionario INT DEFAULT NULL; DECLARE v_dataPedido DATETIME(3) DEFAULT NULL; DECLARE v_valorComissao…
-
1
votes1
answer70
viewsHow can I insert data into two different tables?
I created a function to insert information to two different tables, but it is showing an error: You have an error in your SQL syntax; check the manual that Corresponds to your Mariadb server version…
-
1
votes1
answer114
viewsPrevent values from some columns from being repeated, Mysql
I have the following Mysql query, the results are shown as in the image below, I would like the values of the columns not to be repeated Aluno and NotaGeral based on the column Usuario which is a…
mysqlasked 6 years, 5 months ago Miguel Silva 491 -
1
votes0
answers81
viewsAccent mysql table
Good morning. I have a table in the database and I need to make 2 selects in it: For the first search I’m using this and is returning everything I need: SELECT * FROM wp_memoria WHERE memo_de IN…
-
1
votes1
answer90
viewsHow to Return Existing Primary Key Error in PHP/Mysql?
Good afternoon. How to return an error when there is an attempt to insert a row into a table, and the primary key already exists? By default, the database does not insert the line. How to display…
-
1
votes1
answer34
viewsEncapsulation of random amounts - is it possible?
I’m trying to get php to send a response to the Avascript file with information, in which Avascript makes a request for php in ajax, and php sends a random amount of information, php will pull all…
-
1
votes1
answer108
viewsSQL with empty Join
I need to do this query with Mysql returning according to year. But for those who have no workload the field should be NULL For example: year 2017 SELECT `turmas_has_estudantes`.`id`,…
mysqlasked 6 years, 5 months ago Luis Souza 333 -
1
votes1
answer1261
viewsHow to insert dates into a database table using PHP?
I am creating a form where I need to save the dates that are placed inside the Inputs in a table of the Mysql database, but as I am now apprehending PHP, I am having difficulties, because with the…
-
1
votes3
answers255
viewsCalculate percentage between two MYSQL dates
Good morning! I wanted to calculate the percentage of how many times a classification appears between two dates, the classifications are distributed in "red", "yellow" and "green". This is the table…
-
1
votes1
answer62
viewsShow all products of a Mysql order
Good morning! I created a shop online , this same one consists of a shopping cart. After the user has chosen all the products, a "payment.php" page will appear, before that he inserts it into the…
-
1
votes2
answers2153
viewsHow to refresh the page without forwarding information to the php database
I am working on a simple message system, and it works, but whenever a refresh is given on the page, the information of the last Internet is sent back to the database. And if nothing has been filled,…
-
1
votes1
answer51
viewsTrigger gives error with date
I made a Trigger to count the working days. It accepts the dates of the month 06 very well, but other dates gives the following error: INSERT INTO `teste` VALUES ("2018-05-01") #1292 - Incorrect…
-
1
votes1
answer1217
viewsLoad a TEXTAREA field from a SELECT with Jquery
I have a modal that performs email sending. Only I created some email templates in the database mysql. On the screen appears my select with all the templates for selection, only that I would like…
-
1
votes1
answer114
viewsSyntax error in SELECT MAX
I have a syntax problem in my sql code inside the php code, I need to know which video has the biggest id in the database to save it in a separate folder with the same id number, so that the path is…
-
1
votes0
answers43
viewsNosql and MYSQL - when to use?
The question may be a little generic but I don’t know how to be more specific. When to use a nosql database and when to use an sql? 90% of banks or more have relationships. clientes se relacionam…
-
1
votes1
answer445
viewsCron command without using password to access MYSQL database
Good personal day, lately I’ve been receiving warnings related to a cron I created on 1 site to update certain data from a mysql database table. The error is as follows: Warning: Using a password on…
-
1
votes2
answers51
viewsError while uploading some photos
I made a script that uploads a photo to the server and saves the name in Mysql, but some photos it does not send, some types type JPEG 3 mega up is not sent and gives error. index php.: <form…
-
1
votes1
answer60
viewsSearch unica mysql
I’m doing a db search that needs to resume the sum of a field and the last corresponding value, and grouping them to an index Query $stmt = getConn()->query("SELECT senha,movi,SUM(entrada) as…
-
1
votes1
answer147
views -
1
votes1
answer243
viewsForeign key with 3 primary keys
Hi. I have this table with 3 primary keys and I need to reference it in another table. It’s like? I was just going to put an int-type id in the monthly table to be the only primary key. But each…
-
1
votes1
answer147
viewsDATATABLE CODEIGNITER - INNER JOIN QUERY
Hello! I’m using dataTable in codeigniter and performing a query through the field search Seeing the query below, it works well when it comes to query within the same table tb_pagamento. Now I want…
-
1
votes1
answer334
viewsCreate a new table for optional values
Do you have a problem creating a new table for fields that are not mandatory ? For example in the address table (cod_addressee, path, zip code, number, complement) where add-on is an optional field,…
-
1
votes1
answer32
viewsJquey does not work with inserted elements using . html()
Good night people, then.. I have an ajax code that takes a loop inside a php file and then inserts the result inside an html page. So far, everything works. The problem is when I want to manipulate…
-
1
votes0
answers31
viewsMysql and Jaspersoft
I need to generate a dynamic report through Jaspersoft, the result of consulting three Mysql tables. The tables are: CREATE TABLE IF NOT EXISTS `tcc`.`Catalogo` ( `idCatalogo` INT NOT NULL, `titulo`…
-
1
votes1
answer75
viewsTake value from right set with 'ambiguous' fields
I am making the following query to my database: $escalacoes = 'SELECT * FROM escalacoes AS e JOIN jogador_rodada AS jr ON e.id_jogador = jr.id_jogador WHERE e.rodada = ('.$rodada_atual.' - 0) AND…
-
1
votes1
answer40
viewsData change problem in the database
I am trying to change the data of the database, however, when sending it does not present error message and it does not change the data. What can be happening? if (isset($_POST['enviar'])) { //Slide…
-
1
votes2
answers1357
viewsHow can I show database value in real time?
I’m a beginner in php, let alone js. I would like to take a count of how many users are registered in my database, but in real time using ajax. I have tried in many ways, but without success. for…
-
1
votes0
answers244
viewsChange Table Row Color based on a Database Value
Good afternoon I’m building a system, I register people in the database and I need that when I select a radio box on the page visita_registro.php which makes me include a record in the bank, record…
-
1
votes1
answer59
viewsHow to perform this Select?
I need to relate data according to the last item found in the user table, for example: Table: +----------------+-------------+ | user_id | title_id | +----------------+-------------+ | 154138746 |…
-
1
votes2
answers1049
viewsHow to query MYSQL and PHP using an array as a WHERE pro condition
I’m making a query in MYSQL that brings the emails that were sent. These emails are in the email column, separated by comma, as in the email table below. emailsenviados IDenvio|emails 1…