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
votes1
answer155
viewsTransform Mysql query into Eloquent (Laravel)
I have a simple query on MySQL, the query lists all the data of a table making a Group By in the field grupo_id and listing the latest data from Group By based on the created_at. In short, he lists…
-
0
votes1
answer385
viewsCreation Table Mysql
I recently started to study a little mysql, and decided to create a table of registered here in the club that I am part. Create database Clube default character set utf8 default collate…
-
0
votes2
answers15714
viewsmysql error 1215 cannot add Foreign key Constraint
Guys I’ve researched several other topics about this bug and none solved my problem so I’m posting here for you. Here’s the thing: I have a table called "members" that already has content and I’m…
mysqlasked 7 years, 8 months ago Joao Nivaldo 1,229 -
0
votes1
answer616
viewsSearching for separate words in the same string in Mysql
My question is relatively simple, but I couldn’t find an answer that would really help me: My user searches for a name in a form: Fulano Silva The record in my bank is like So-and-so of Tal Silva…
-
0
votes1
answer27
viewsInserting Data Conditionally in MYSQL
I have a table: conluna1, column2, column3.. The first two columns have integer data, 0 and 1, while the third column is without even a record. I would like to fill this column according to one…
-
0
votes1
answer398
viewsConsult BD after leaving the input focus and return results without refreshing?
I have a table that has about 30 input fields to perform a release, example: <input type="text" size="8" name="Codigo[]" placeholder="Codigo" maxlength="8" /> <input type="text" size="8"…
-
0
votes1
answer1298
viewsHow to send 2 arrays/parameters through the url?
I am trying to send two parameters of the shopping cart through the url ,for later the client to make the confirmation, but I can only receive an array on the other page and do not know how to…
-
0
votes2
answers53
viewsQuery error in Mysql using PHP
Could you explain to me why PHP code does not execute variable code (this code is a query) in the ELSE part. When the IF (Ifcontains complements of a query that will be executed in mysqli) is not…
-
0
votes0
answers38
viewsUsing PHP, how can I fetch values from tables?
I’m new to the programming, but I wanted to know how I get information from the tables,: The code I currently have of the query is this: $resultado = $ligacao->query("SELECT cursos_has_lisboa.*…
-
0
votes0
answers42
viewsInsert primary and foreign key at "same time" SQL
Suppose two tables "company" and "employee" within employee has a key Foreign for the company When the user goes to create a new company he answers a form that in this form he adds the name of the…
-
0
votes1
answer402
viewsHow to return data array with Join in Laravel with the DB class?
I need some help with that SQL of Laravel: $process = $db->table('processo')->where('nrprocesso',$id) ->leftJoin('viatransporte', function($viatransporte){…
-
0
votes1
answer156
viewsCodeigniter update works but wrong list
I’m having a problem updating a bank record by codeigniter, I have two tables, one call: employee(where the employees of the company are stored and in which sector the employee works,this table has…
-
0
votes1
answer185
viewsHelp in logic to not overlap a band of schedules already exists at the base
Good morning. As suggested by a community member, in the post that started this, I come to ask for collaboration in a logic. I have a table that contains the fields start time and hora_termino. I…
-
0
votes2
answers206
viewsMysql - auto increment shared between tables
It is possible to share the auto increment value of two tables? Example: Tabela 1 +----+-------+-----------+ | id | campo | criado_em | | 1 | a | 00:00 | | 2 | b | 01:00 | | 5 | c | 04:00 |…
-
0
votes1
answer50
viewsReferences lost at persistence time
Below follow my entities and their relationships: Order: @Entity @Table(name = "encomenda") @XmlRootElement(name = "objeto") @XmlAccessorType(XmlAccessType.FIELD) public class Encomenda { @Getter…
-
0
votes1
answer640
viewsHow to Count With Subquery
I need to count table fields, however, these fields have different types of filters within Where. I need to be shown the consolidated information, I tried to do openquery but returns error. select…
-
0
votes1
answer166
viewsHow to clear the Foreign Keys field in SQL
I wonder if there is a way to clear the user_id/store_id reference present in the table user_store CREATE TABLE IF NOT EXISTS `user`( `id` INT(11) PRIMARY KEY AUTO_INCREMENT) CREATE TABLE IF NOT…
-
0
votes1
answer46
viewsHow can I pass more than one point to google maps in that while?
I wanted to mark all the points where the approximate distance is less than 25 km, but it doesn’t even show the first point that is the nearest (4km), it shows the last one (18km). Follow what comes…
-
0
votes1
answer129
viewsHow to set up Laravel Sending Driver with Dynamic Sender
MAIL_DRIVER=smtp MAIL_HOST=smtp.gmail.com MAIL_PORT=587 [email protected] MAIL_PASSWORD=Senha123 MAIL_ENCRYPTION=tls How to leave [email protected] and MAIL_PASSWORD=Senha123…
-
0
votes1
answer1038
viewsError inserting data into Mysql table
I’m trying to send data to the MySQL , of a restaurant reservation , but it only worked the first time and now when I try to send will no longer. What possible error in my script? File Connection…
-
0
votes1
answer23
viewsReturn message using declare?
I need to check a variable on MySQL similar to that of the SQLSERVER. where i check return on a variable in the bank’s own message example in SQLSERVER I do so: DECLARE @nome VARCHAR(20) = 'NOME'…
-
0
votes1
answer39
viewshow to connect to Phpmyadm database?
he make that mistake here: Uncaught Error: Call to Undefined Function mysql_connect() I can’t connect to the database.…
-
0
votes0
answers42
viewsI’m having trouble accessing the Mysql server
I am using Heidisql to connect to my Mysql servers. On the machines I set up I can connect smoothly to the Mysql server. But in the case that it was not I who set up is giving the problem of: Access…
mysqlasked 5 years, 8 months ago Alberto Vitoriano 23 -
0
votes1
answer619
viewsDynamic Combobox Information Filter
I would like to know how to make a dynamic data filter, to appear only the data related to the selected, for example: I have in my bank the table Empregado and Empresa, as an example I have: Staff…
-
0
votes0
answers143
viewsHow can I write a Datetime-Local HTML input to the database with the Datetime type Field?
In the project I am developing in PHP I need one in a registration form. I wanted to know how I can save this data in the database, I tried to use the type Datetime in MYSQL, but this type has the…
-
0
votes1
answer48
viewsType varchar mysql limit
Can anyone explain what the varchar limit is? I read the following: a Mysql database has a limit of 65,535 bytes (for the entire line) However, how byte counting is performed? My initial thought is…
-
0
votes0
answers96
viewsPDO execute() with connections does not work
PHP version: 5.6 Framework: Slim Search Engine to bd: PDO I have the following database search: $cIndus = array("ex1", "ex2"); $query = "SELECT `nome_agr_corr` AS `brita`, CASE WHEN ? = 'usd' AND ?…
-
0
votes2
answers38
viewsError SQL syntax when exporting CREATE TABLE (Myphpadmin)
I’m new here and haven’t started my studies in SQL and PHP, but I would like to ask for help. When trying to download a theme content from my site in WP, error msg appears: Cannot export CREATE…
-
0
votes1
answer66
viewsHow to process in Mysql with select
I would like to know how to create a project that select in several fields of a table. Would be a select list, I tried to do but I have no idea where to start. DELIMITER // CREATE PROCEDURE…
-
0
votes1
answer489
viewsChange String Color upon return of Mysql
I have the code below, if the score column has a field with "LOW" the color of only LOW has to be (#FFFF00) and if the field is HIGHT, only HIGHT has to have the color (#FF0000): <?php while($row…
-
0
votes1
answer55
viewsData search problems by name, returns nothing
I’m having trouble searching for data by name. Following is the code. From now on, thank you. <?php include_once 'dbconfig.php'; ?> <?php include_once 'header3.php'; ?> <div…
-
0
votes1
answer21
viewsFind records between a range of seconds
I have a table where the date field contains full date (with seconds), I need with a given date, search all records with 10 seconds above and 10 seconds below, the query I tried to do is this:…
mysqlasked 5 years, 7 months ago Joao Abdalla 13 -
0
votes1
answer106
viewsHow to return a Mysql query with specific characters within each cell?
If in my column there is a field in this format: 181202272, (a varchar of 10 characters), I would like to return in my query through a SELECT by Mysql in this way: 18:12:02.272 //Nos dois primeiros…
-
0
votes2
answers264
viewsRemove First Name and Last Name from Full Name
I am using the SUBSTRING_INDEX command to get the first name and last name of a table field "Names". SELECT SUBSTRING_INDEX(nome_completo, ' ', 1) AS primeiro_nome, SUBSTRING_INDEX(nome_completo, '…
-
0
votes1
answer136
viewsHow to make the checkbox 'checked' after saving in the bank?
My checkbox are saving normally, however, when I leave the page and come back, they do not remain checked. Clients.blade.php <body> <form method="POST" action="/user/update/client">…
-
0
votes1
answer73
viewsSelect from today until a week ago
I want to select a sql date from today until a week ago, I found this code here 'SELECT * FROM tb_user WHERE registro BETWEEN CURRENT_DATE()-7 AND CURRENT_DATE() ORDER BY registro ASC'; more it…
-
0
votes1
answer303
viewsAverage and filter by values above this mean
I would like to average the amounts spent by all customers. Then list the names of customers who spent above average (can be using inner join, but with sub-consultation): SELECT a.primeiro_nome,…
-
0
votes0
answers26
viewsDisplaying forms through Select with Jquery
I have a select field for the user to choose which form to register the data! ( 2 forms to be displayed). When selecting the first option in select, I am using Jquery Hide() and show() to display…
-
0
votes0
answers30
viewsData display in PHP dynamic menu with no results
Hello. I am from the beginning of the week trying to finish the dynamic menu I created but I can’t display the div corresponding to the link as well as its contents. Describing better, I have a…
-
0
votes2
answers39
viewsComplete number of query records
Hello! I have a table in BD that can contain from 0 there are 12 records. (as a monthly income chart during the year. totaling 12 records) I want to make a query in this table and I want it to…
-
0
votes1
answer651
viewsSelect "select" values through "GET"
I’m trying and I can’t seem to do the following: I thought to "automate" the system reporting process that I am doing, for this, when registering the PRODUCT, you also register the column id name…
-
0
votes1
answer50
viewsError accessing C# Visual Studio database
I’m doing a job of the facul, and I started him on the job this week, then came weekend I put the project on the USB stick and exported the database by Mysqlworkbench tbem, I was able to import the…
-
0
votes0
answers34
viewsHow to make an edit page for each record?
Hello, I have a school report card system in PHP where the responsible one registers the students. The problem is on the student edit page, I can not set a single student, the page link appears the…
-
0
votes1
answer69
viewsMysql Xampp connection error
Xaamp displays the following error and does not connect to Mysql 13:39:38 [mysql] Problem detected! 13:39:38 [mysql] Port 3306 in use by "Unable to open process"! 13:39:38 [mysql] MySQL WILL NOT…
mysqlasked 5 years, 7 months ago Jean Michel Neto 11 -
0
votes2
answers31
viewsSelect as a result of one day of the week
Well I have a select that returns the total order amount made in the current week. I do it as follows: SELECT SUM(valor) FROM pedidos WHERE YEARWEEK(data) = YEARWEEK(NOW()) Well I need a select for…
mysqlasked 5 years, 7 months ago Hugo Borges 5,294 -
0
votes1
answer156
viewsINTO OUTFILE command saves file without header, how to set header?
Good afternoon, everyone, I am running the following command to save files coming from MYSQL. Works however I cannot save the file with header, the data comes without header. SELECT * INTO OUTFILE…
-
0
votes0
answers72
viewsProblem with Wordpress and Mysql connection.
All right, guys I developed a news portal for the company I work for and on this portal I have an average of 500 thousand monthly accesses. I’m having for some time many problems with my site. The…
-
0
votes2
answers248
viewsClose PHP and ASP connection or not?
Making my applications in ASP I make a include at the end of all pages by disconnecting the bank. In PHP you need to disconnect too? another question: How to close this PHP connection? $conexao =…
-
0
votes2
answers28
viewsList in Mysql tables that do not have AVG
I have two tables in Mysql like this: LOCAL id | nome NOTA_LOCAL (user notes for each location) id | id_local | nota I’m listing the locations and already showing the average of notes that each…
mysqlasked 5 years, 7 months ago caiocafardo 1,897 -
0
votes1
answer320
viewsDifferent server time with PHP
I ask him to save in the comic book like this: $datacadastro = date('Y-m-d H:i:s'); And he’s out an hour longer than he is on the server. 2019-04-17 13:06:59.000 How do I save it according to server…