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
answers44
viewsCreate CONSTRAINT FOREINGN KEY with primary key type VARCHAR from another MYSQL table
I have two tables a call _hardware_ and another call _responsavel_. In the _responsavel_ have a Primary Key calling for NIP of the kind VARCHAR(8). I created a field called NIP_RESP also VARCHAR(8),…
mysqlasked 6 years, 6 months ago Anderson Fidelis 311 -
0
votes1
answer119
viewsPHP code to query MYSQL by leaking memory
All right, guys? Guys, I’m having a problem that I haven’t had before. I wrote the code below and at the time of opening the page by localhost in the browser it returns the following error: Fatal…
-
0
votes0
answers647
viewsSend value "0" or "1" from the checkbox to the database
I have the table "Cd_comments" in the mysql database, with the column "comment_id" "user_id" "text" and "anonymity" I want to make a system for a website, where the user will comment, and if he has…
-
0
votes1
answer142
viewsCumulative count per month
I’m having difficulty making a cumulative count in mysql. I need to count the amount of active registration accumulated in each month. Table: id | data_cadastro | data_exclusao…
-
0
votes1
answer188
viewsUse result of an SQL query as attribute to another query.(MYSQL)
I have the following structure: tabela (Grupo): -cd_grupo -nm_grupo -ds_filtros -> Aqui armazeno parte do comando SQL utilizado como filtro , para posteriormente atualizar. I store the following…
-
0
votes2
answers551
viewsPHP Warning: mysqli_close() expects Parameter 1 to be mysqli, Boolean Given
I’m having this problem. does anyone know why? This is from a php book My log reads this [Sun Sep 30 22:56:16.203629 2018] [php7:warn] [pid 31940] [client :1:53268] PHP Warning: mysqli_query()…
-
0
votes2
answers529
viewsAvoid double quotes in CSV file exported with PHP
It is possible to prevent the file CSV come with aspas duplas in string fields, I am using the script below, but the field nome is coming between aspas duplas, how can I avoid this? <?php…
-
0
votes1
answer634
viewsPython - Keyerror
Someone can help me ! I am reading a csv file and then I do an INSERT in Mysql database, but I get the following error Keyerror: 'id' I have checked the CSV file several times, the file has all the…
-
0
votes1
answer144
viewsSearch with date in Laravel
Devs, good afternoon I’m having the following problem, I have the sequinte query I’m running with DB::raw() From Laravel, I need the date to be passed to query as a string with simple quotes only so…
-
0
votes2
answers105
viewsAdd FK in mysql table
Good morning I am facing the following problem, I created 2 tables in the bank, while trying to create a fk in one of them generated the following error:#1215 - Cannot add Foreign key Constraint.…
-
0
votes1
answer299
viewsProblems using INSERT in PHP (mysqli)
i (beginner in the field of php development) am having problems inserting data using the code below: <?php $conn = new mysqli("zz", "zz", "zz", "zz"); // Alterei a string de conexão por questão…
-
0
votes1
answer28
viewsMysql and PHP Comparison SUBQUERY
I made a query to select all user records of a table, but I inserted a filter where the admin selects the state and filters only the user records of the selected UF, but is giving error in return.…
-
0
votes1
answer81
viewsinsert only one field with Pdo
Eae you guys, my problem is the following am using php’s PDO object to insert records into the database, the problem is when I try to insert only one field into a table example: $query = 'INSERT…
-
0
votes0
answers307
viewsChange mysql root password on linux!
Good afternoon Personal! I’m new to the world of development and I’m new to linux. I installed the mysql client and server and then installed mysql-workbanch via Xubuntu program center. At no time…
-
0
votes1
answer81
viewsHow to Put Two Like in the same condition Mysql and PHP
I am in the struggle of a system in php and mysql sales system etc.. it has everything working, but accurate at the time of sale, the person can search both for (idCodigo or Description). without…
-
0
votes1
answer141
viewsAdd comma-separated records - PHP + MYSQL
In mysql database I have the following table: Note that the column field is in json format. I have several records in a single field. I need a script to count each record separated by comma and add…
-
0
votes1
answer133
viewsHow to create a function for my IF with Class Public Function?
Well, I have the following public function: /** * Mostrar notícias * * @param string $featured - Define se será noticia de destaque ou padrão que mostrará * * @param string $date - Define o tempo em…
-
0
votes1
answer30
viewsGenerate batch accounts with corrupted date
Good evening everyone, I am developing a project in which I Charge accounts in batch depending on the amount of months that the user selects being at most 12 months, ok the CRUD of these accounts,…
-
0
votes1
answer35
viewsGraph bars in red when value below the stipulated average
I use this script to generate average graph of questions, how to make the bars change color (red for example) when the media is less than 8 (for example) <script type="text/javascript">…
-
0
votes2
answers376
viewsDjango does not connect to mysql database
was doing this project on linux Mint and I had to switch to windows and I’m having some problems to configure the environment. when rotating the command $ python Manage.py migrate get the following…
-
0
votes2
answers4117
viewsSQL how do I enter into a table that has FK?
How do I make a insert into in a table where there is a FK? example this is my structure Pessoa ID (primary key) nome varchar(20) id_endereco int not null (foreign key)…
-
0
votes1
answer615
viewsMYSQL Time range
I need to search on a server, through a command, an interval of 2 hours of a saved data relative to the server time. Example: An employee opens a call; this call will be saved to the bank on date X…
mysqlasked 6 years, 6 months ago ALAN BERTOLDO OLIVEIRA 11 -
0
votes1
answer60
viewsHow to bring data from another table related to an id_user (JOIN??)
I have the following tables: Users And investments The investment table has the user id. I’m already able to register. How do I show the investments made by a user on the screen? I’m already able to…
-
0
votes1
answer403
viewsPhp post approval system
I am creating an approval system of posts middle in "Gambiarra", what I did is, when the user makes a post, it receives the value '0' in the table 'Status' in the database. So, I have a restricted…
-
0
votes1
answer71
viewsPass mysql class to mysqli error in query
I have a problem to pass the consultation (this->Query($sql)) and the rest to mysqli. I don’t know how to proceed MISTAKES: PHP Warning: mysqli_query() expects Parameter 1 to be mysqli, null…
-
0
votes1
answer26
viewspull registry and filter from mysql pro php
I’m trying to pull the information in Mysql and show it in php, with a filter in the name of the room $reserva = mysqli_query($connect, 'select * from reserva join curso on reserva.idCurso =…
-
0
votes1
answer134
viewsReturn Data from MYSQL (Data) to HTML Tables
could you kindly help me with the following mistake: Recoverable fatal error: Object of class Datetime could not be converted to string in C: xampp htdocs Portalpib query transactions.php on line…
-
0
votes1
answer789
viewsCRUD in PHP and MYSQL - Delete
I’m having trouble at a crud in php and myqsl. My code doesn’t seem to be getting the id to perform the actions. The site has an administrative part in which I view registered users and can edit,…
-
0
votes0
answers11
viewserror editing data from a PHP page to Mysql table
Because when I try to edit in a table in Mysql and the amount of lenghts is high, the program does not let edit? Ex: I gave a var_dump in the edit query... These are only fields: id, title, txt1,…
-
0
votes0
answers106
viewsJava CRUD problem using Mysql
In my DAO class, I have the method to enter in the database, but in my system screen I can only update the fields if I make a change in all fields. Example: my table has 4 fields and I only modify…
-
0
votes0
answers331
viewsHelp by returning errors - > Warning: Illegal string offset 'id'
define("HOST","localhost"); define("DB_USER","root"); define("DB_PASS",""); define("DB_NAME","cc_cond"); $conn = mysqli_connect(HOST,DB_USER,DB_PASS,DB_NAME); ini_set('display_errors', 1);…
-
0
votes1
answer230
viewsHow to implement password encryption?
I want to implement password encryption in user registration. I found here in stackoverflow this post teaching how to use cryptography, but I’m in doubt where to add the code. This method should be…
-
0
votes1
answer393
viewsQLSTATE[42000]: Syntax error or access Violation: 1064 You have an error in your SQL syntax (PHP and Mysql)
I am developing a virtual store with PHP 7 and Mysql. In the model class of requests, SQL seems to me to be correct, but since I’ve been trying to solve the problem for some time, I may be missing…
-
0
votes1
answer81
viewsGrab subquery ID field that only draws Mysql name
Good afternoon! I have an SQL query and would like to get 2 additional fields from other tables, but with other names so that they are not ambiguous. See the last two Queries to rescue 2 fields like…
mysqlasked 6 years, 6 months ago Maykel Esser 598 -
0
votes0
answers26
viewsHow to split file for import
I have a file that has no data separation and I need to insert it in the database, how can I import it. For example, the file is like this: 931398401312 I want to divide it into 4 columns, example:…
-
0
votes1
answer62
viewsIs it possible to use two identical id’s in the same table?
I have a situation that I need to ask a question. I have a table as below: CREATE TABLE confrontos( id_confrontos INT AUTO_INCREMENT NOT NULL, dt_confronto DATE NOT NULL, id_estadios INT NOT NULL,…
mysqlasked 6 years, 5 months ago Carlos Henrique Eltz 1 -
0
votes1
answer416
viewsIntersection between same table, auto relationship, mysql with INNER JOIN
Hello, I’m making a facebook clone database. I have two tables, one of users and another friendship. The friendships table is a self relationship of users as shown in the image. This table of…
-
0
votes2
answers148
viewsOpen connection more than once in C#
I am developing a service in c#. calls a function to check if it has active records. if you have any record call another function to select the data referring to the first query. When I run my…
-
0
votes0
answers23
viewsQuick way to search first record
I’m performing the following query in Mysql: select id from positions where device_id = {$device_id} and p1 IS NOT NULL order by time desc limit 1 But the query is taking too long, because the table…
-
0
votes1
answer463
viewsWrong sequence MYSQL line numbering
Simply put, I have two tables, perguntas and respostas, for each pergunta 4 or more respostas, turns out I’m not getting numerar as linhas correctly when grouped by questions. My result: | linha |…
mysqlasked 6 years, 5 months ago Miguel Silva 491 -
0
votes2
answers66
viewsProblems creating a foreign key
Staff need to create a relationship between table attendance and table category, but every time I try it gives error 1215 cannot add Foreign key. What am I doing wrong? Both tables are empty. CREATE…
mysqlasked 6 years, 5 months ago Joao Nivaldo 1,229 -
0
votes2
answers692
viewsHibernate, JPA, does not save the new data in the database
I have a Java Spring MVC application, with Hibernate and JPA and HTML interface. I have two forms that depend on the Notebooks class and its attributes. In the first form I enter the data of a new…
-
0
votes1
answer71
viewsList the best-selling product per day in a comic book store
I need to list the most sold product per day in the store, showing the description, type and day. How far I’ve come: SELECT Data, MAX(QtdVenda) as Vezes_Que_Foi_Vendido, IDProduto, Fabricante, tipo,…
-
0
votes1
answer44
viewsBring data from range
I would like to bring even those where there was value in the consultation For example; table dice id | valor | data 1 | 5 | 01/10/2018 2 | 6 | 03/10/2018 3 | 7 | 04/10/2018 5 | 8 | 05/10/2018 I’d…
-
0
votes1
answer191
viewsHow do PHP read Mysql from the bottom up?
My code is this: //Receber o número da página $pagina_atual = filter_input(INPUT_GET,'pagina', FILTER_SANITIZE_NUMBER_INT); $pagina = (!empty($pagina_atual)) ? $pagina_atual : 1; //Setar a…
-
0
votes1
answer393
viewsSend multiple mailing lists from Mysql with Phpmailer
I’m trying to send some emails with Phpmailer but always get an error message: Invalid address: [email protected], [email protected] I’ve checked everything I know but still can not, here my list is…
-
0
votes0
answers25
viewsHierarchical data. What would be the most appropriate ER Diagram to implement a Labels system like Gmail?
Something related to hierarchical data. I am implementing a Labels system for messaging a website that is similar to the gmail Labels system. This is the short ER. A message may have one or more…
-
0
votes0
answers44
viewsSave a datagrid column in the database
I need to get the value of the discount column from mine datagrid and save in my database, will I get, it is calculated when I record consumption according to quantity, follows below the code:…
-
0
votes2
answers3840
viewsCompare dates in sql
In my bank I have the field with datetime current_timestamp in the access table. I need to display the amount that each device accessed the site, whether computer, Ios or android, each time one of…
-
0
votes0
answers78
viewsJava JDBC Mysql syntax error
I have a syntax error here in the mysql query inside the Java code, in the repository. The error is both in the CHANGE method and also in the Delete. package…