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
votes1
answer219
viewsQuery in date column with current week filter
I’ve been looking for a mysql command that does such a function. The purpose of this is that I have to display a current week’s item schedule. From Sunday to Saturday. Is there a query that makes…
-
1
votes2
answers71
viewsSelect from all companies that have catalogues
I’m having a problem at a select in two tables that are returning the value twice. I have the table businesses and table catalogues which are linked by company id. and catalogues.id_company. When I…
-
1
votes2
answers1140
viewsReturn last record of each object
I have the following table: imovel ano | id | item | valor Records: 2000| 1 | 201 | null 2001| 1 | 211 | 10 2002| 1 | 202 | null 2000| 2 | 201 | null 2001| 2 | 221 | 17 2002| 2 | 211 | 14 2000| 3 |…
-
1
votes1
answer206
viewsHow best to avoid sql inject
Well I have 2 ways to prevent sql inject, are they: first $input = $conexao->real_escape_string($input); 2nd $input = filter_var ($input, FILTER_SANITIZE_SPECIAL_CHARS); Query select * from…
-
1
votes1
answer2150
viewsPhpexcel, select sheet when importing data to mysql
I want to import data from a spreadsheet but from sheet 2 and I’m not getting it. I have indicated sheet 2 (index 1) as active in this way, but it always enters sheet 1 (index 0): $objWorksheet =…
-
1
votes3
answers1538
viewsHow to insert the data into a specific field of a _mysql_table?
I have a table called company, with the fields name, addressee, city, telephone, email and link. How should I proceed to enter a value in the field link that is empty?…
-
1
votes4
answers1009
viewsConnecting PHP to the Mysql database
I need help I am trying to connect my PHP file with the database to be able to perform a query and present on the screen the records. Connection code: define('usuario_bd', 'root');…
-
1
votes2
answers70
viewsInsert php field concatenating date
I would like to know how to insert the following combination, via PHP or mysql: I have a field called YEAR that needs to receive the current YEAR 2017 format, via php or mysql. I have a code field…
-
1
votes0
answers87
viewschanges in linked tables (CASCADE etc...)
I am learning MYSQL on my own due to the teaching restriction that there is in my city and its vicinity, so I would like information on how to use CASCADE in the table that I have with this…
-
1
votes2
answers49
viewsUpdate table field with information from another column
How to do an update that recovers data from one column and plays in another column? For example Sales IdVenda | dataVenda | dataPgto 1 | 2017-08-21 | 2 | 2017-08-21 | Want to update the dataPgto…
-
1
votes1
answer265
viewsIdentify and archive old Mysql records
I am working on a project using database in MySql where some areas will be constantly fed generating a high number of records in a short time, such as an area for maintenance tickets. However, these…
-
1
votes1
answer1578
viewsLaravel - Save data in the database only if it does not exist and....
I have a person registration system and there is an area with several checkbox fields that represent the social group that the current person represents: TABLES person id | nome 1 | João 2 | Maria 3…
-
1
votes2
answers4580
viewsPHP - How to compare a date that comes from the Mysql database to the current day?
I have a column in the database which is in format DATE (Y-m-d). In php code I recover this string and have to compare with the current date and this is the condition I am using:…
-
1
votes2
answers64
viewsHow to add up the amount of records in which the penultimate record enters the Where?
I need a query, in MYSQL, that checks the penultimate record and that this record is equal to a certain value, and that counts the amount of records found. Ex: penultimate record is John’s. I need…
-
1
votes3
answers62
viewsGet only 1 of each journey
Well, I have a table called tabelajornadas. In it, I have several records, and in which I have the column jornada, who’s kind int. In it, they contain several records with the same number in the…
-
1
votes5
answers11915
viewsCount number of Mysql query records in PHP
I made the code below to count the amount of records, but he tells me 1 to 1, I wonder how I can do to add these records and call with an echo. ?> <?php $sql="SELECT id FROM processo"; $return…
-
1
votes0
answers82
views -
1
votes2
answers232
viewsMysql Query - Two tables and date range
I have two tables, one for the technicians' register and one for the tasks. It’s a 1->N relation. Table 1 (TECNICO): cd_tecnico | nome Table 2 (TASK) cd_tarefa | cd_tecnico | dt_inicio | dt_fim I…
mysqlasked 8 years, 5 months ago user3771516 433 -
1
votes1
answer250
viewssum of PHP and Mysql values
Good afternoon, Friends I am creating here a system of notinhas to use in the company it is very basic, but I am doubtful on how to set up the payment function so that it identifies the values some…
-
1
votes2
answers1073
viewsHow to filter only the date of a field that has date and time set?
I need to create a select in Mysql to filter the month in a table, but the field where the date is set has also set the time, thus: [2017-02-04 10:00:00] How do I filter only the date of this field…
-
1
votes1
answer482
viewsHow to order a group in the mysql query?
I’m trying to order a query in the database grouping the information, but this showing the first registered in the database, but I want the last. SELECT * FROM base_rating AS B JOIN historico_rating…
-
1
votes1
answer142
viewsHow to join 4 tables in SQL that is returning empty ? (Inner, Outer or left Join )
I have 4 tables with the following relationships: Products has N Variations Sizes has N Variations Colors has N Variations Variations belongs to Products,Sizes and Colors The structure of the tables…
-
1
votes1
answer234
viewsTo have a database in phpMyAdmin you need the database in Mysql?
Hello, I would like you to help me on a question, my code makes connection with my bank that is in phpMyAdmin, and in some places that I read, I verified that it is a bank manager. My question and…
-
1
votes1
answer695
viewsMYSQL query bring results in order of distance using coordinates
I have a table that has the coordinates (latitude and longitude) of the users. How do I make a query to bring who is closest to the location. Ex: ID | Lat | Long 1 | -22.874428 | -43.372334 2 |…
mysqlasked 7 years, 2 months ago Leandro Marzullo 1,401 -
1
votes2
answers1272
viewsProblems with UTF-8 in PHP project
I am learning PHP and I am facing some problems with the special characters, see: the funny thing is that in the table items it displays the accent and the special characters. And yes, I’ve tried…
-
1
votes1
answer150
viewsComparison and calculation of time and date
Well I retrieve the date and time of a record like this: $sql = $conexao->query(select data, hora from pedido); $resultado = mysqli_fetch_object($sql); $resultado->data; $resultado->hora; I…
-
1
votes3
answers804
viewsHow to know if the database query was successfully performed?
I have a database of people, the name of my db and Register and in it I have a table users with four columns already filled id, age, name and email i am developing a user search system here is the…
-
1
votes2
answers853
viewsCOUNT in several tables
I have two tables in my system, and I need to count two columns in the tables. I currently do through a VIEW as follows: CREATE VIEW totais AS (SELECT (SELECT COUNT(publications.id) FROM…
-
1
votes1
answer176
viewsForm does not import "values" from database
In my system has a registration page and a page with a table with the information of registered. In this table there is an edit button that links with an equal form of the registration page. What…
-
1
votes1
answer254
viewsHelp to convert mysql to mysqli
I’m a little layy in PHP and MYSQL and I’m having a need help problem to convert the MYSQL connection to MYSQLI follow the codes below: mysql.php <?php Class mysql { public $query; public…
-
1
votes1
answer2487
viewsSyntax error: Missing semicolon
Syntax error message: Missing semicolon is appearing in my END IF, more specifically only the IF is underlined with red: DELIMITER $ CREATE PROCEDURE cadastraEleitor(IN nome VARCHAR(100),dataNasc…
-
1
votes1
answer124
viewsphp - No update in Boolean field
I am trying to update the user data, but the active field is not updated. I have tried several changes and also change the variable value $active of boolean for int, but without success. Another…
-
1
votes1
answer98
viewsHow to save sessions in the browser
How to record sessions in the browser with php. Currently I have a login system, and always validates [$_SESSIONS] existing in the browser, but every time I close and open the browser again, the…
-
1
votes2
answers62
viewscensor a registered word in a database
Is there a way to censor and replace a word registered in Mysql through a precedent or Trigger for example? The word in the case would be Flash House and I need it replaced by Old School.…
-
1
votes0
answers191
viewsupdate table with Foreign key
I am trying to update a table with foreign keys, precisely in foreign keys I want to leave them with value NULL update but I’m not getting this is my query: $sql = 'UPDATE agenda SET…
-
1
votes0
answers325
viewsfree server for testing(php, mysql)
Maybe this is not the focus of the community, but someone knows of a free server to test php and mysql?
-
1
votes0
answers39
viewsDoubt Mysql ENGINE=FEDERATED
Good night, Someone managed to help me, I am in a project where I need to make relationships of tables in other servers, I am using as follows: Here I am creating the connection url dynamically: set…
mysqlasked 7 years, 2 months ago Anderson Oliveira 11 -
1
votes1
answer1054
viewsHow to optimize this query in Mysql that is too slow?
I’m doing a simple query on LMS Moodle to get the amount of hits from all users. SELECT count(userid) as total, action, userid FROM mdl_logstore_standard_log log WHERE action = 'loggedin' GROUP BY…
-
1
votes1
answer90
viewsAndroid Load JSON
I need to get the information from a JSON, I created a php code that transforms the database into mysql in JSON https://portfoliounopar.000webhostapp.com/index.php, Now I need to take this…
-
1
votes1
answer281
viewsDelete created entity from a Manytomany relation
I have a relationship ManyToMany amid users and profiles mapped with Hibernate: user: id name profile: id profile_name user_profile: user_id profile_id The mapping is done as follows: User:…
-
1
votes1
answer139
viewsCategory query in Mysql
I’m learning Mysql, I need help, I need to perform a query that returns a sales list by product category. ++++++++++++++++++++++++++++++++++++++++++++++ tb categoria campos: (id, categoria) dados:…
-
1
votes2
answers170
viewsAvoid duplication in Mysql
Duplication of mysql ? I’ve been searching and nothing fits my case, every time I try to duplicate it. I’m trying to import it on the table: INSERT INTO profiles (id, rep, gems, plevel) VALUES (id,…
-
1
votes2
answers2607
viewsMysqldb - insert value of a variable in the database
i am facing problems while trying to insert the values of my variables into the database I am trying to do as follows import MySQLdb id = 4 idade = 18 nome = 'cebolinha' email = '[email protected]'…
-
1
votes1
answer170
viewsproblem when entering Unicode value into database
I am breaking my head with this since yesterday I have done everything to enter the value in utf8 but it is not working and the following I have this code as an example #!/usr/bin python # -*-…
-
1
votes1
answer1533
viewsSplit column into multiple rows (split)
I have a table cidade_bairro with several cities and neighborhoods. I want to transfer this data to a new table, but in several lines instead of being in one. EX: Cidade Bairros<br> SP |…
-
1
votes0
answers77
viewsExport data from Informix
I’m developing an application based on the data of an ERP. This ERP uses the INFORMIX database whose file export standard is BOUNDED BY PIPES AND WITHOUT TEXT RATING. I need to import Informix data…
-
1
votes2
answers354
viewsUpdate command does not update table
I’m having trouble with my CRUD. My code searches in BD and returns me the data on the screen correctly, the problem that when I saved, it does not update the BD and also does not display any error…
-
1
votes1
answer412
viewsPHP and javascript - Getting javascript value in PHP (use of Session)
On the site I took over from another developer, done in PHP and Javascript, there is a search for events created (all registered in Mysql database table). In each event searched, I created a button…
-
1
votes1
answer648
viewsHow to display a result using 2 selects
I have two table, Products and Orders. I need to create a combobox for products and when the user choose a product, the page has to display all orders related to the product, if I choose another…
-
1
votes1
answer142
viewsWhat is the function mysql_store_result() for?
Hello, I’d like to know the real function of the mysql_store_result() method within the C++ language when we are working with mysql database.