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
votes2
answers150
viewsIs this kind of normalization feasible?
From here you will have more tables where the person will classify as, owner, customer, supplier, among others. My question is, by separating one table for Cpf and another for cnpj from the person…
-
0
votes1
answer234
viewsList the last record of a table field
I’m wanting to list the last record of the table and display, but I’m not getting. The Reports table has the field Registration date Duration and destination_id registration date time duration…
-
0
votes0
answers650
viewsWorking in the same bootstrap modal after submitting a form
I am working on a project with Bootstrap Modals. I have already done the modals to create content, delete, etc. But, I need to have one for editing... And I’m having a little trouble. MODAL UPGRADE:…
-
0
votes1
answer315
viewsHow to create table relationship in mysql
I’m starting with a relational database and I have difficulty relating the tables, I’m a layman. I ask for help by indicating a/some clear and objective books on the subject. Grateful for the…
-
0
votes0
answers24
viewsImage upload code does not send gif to folder
I was trying to send images to the database, and the best way was to save them in a directory and send only the name to MYSQL, only when I send a gif, it n goes to the directory but usually goes to…
-
0
votes1
answer179
viewsneed to put an extra left Join in this query
My code is below he returns me "h. banks as banks" with a number, which is foreign key I want him to return me to the description of this bank, only that in many cases, h.banco returns me as null…
-
0
votes1
answer2415
viewsTake values from only one row of a table
Hello, I have a project, and I would like that, when the user entered your account, could, through a PHP action, see your basic data, taking only values from that table, here’s what I have so far:…
-
0
votes1
answer35
viewsProblems when creating an event
I am trying to create an event but get the error below: And my query: CREATE EVENT insert_count ON SCHEDULE EVERY 50 SECOND COMMENT 'bla bla bla bla bla bla.' DO BEGIN INSERT INTO teste (nome,…
mysqlasked 8 years, 1 month ago Cesar Augusto 300 -
0
votes1
answer729
viewsSQL - Category & Subcategory
I have a category and subcategory structure. And I need to list all categories, and then their subcategories... But the listing went wrong. I’m using the codeigniter. Structure of the Database: SQL…
-
0
votes1
answer58
viewsSelect in mysql from such Input
I am making a query in the database and have to return the table from such index. for example: | Ind | value | |001| AAA | |002| BBB | |003| CCC | |004| DDD | |005| EEA | |006| FFF | |007| GGG |…
-
0
votes1
answer57
viewsProblems saving with selectOneMenu.
I’m trying to save a record of Activities with information from Favored. I cannot save in any way. I will put the code and please if anyone can help me thank you. < package br.com.sentinel.Bean;…
-
0
votes1
answer483
viewsBackup mysql database in PHP
I need a backup knob that I can select a folder where will save my mysql data.. I found some mysql dump codes but all with save location defined via code and what I really need is that it is…
-
0
votes1
answer137
viewsHow to Save Form Data to DB with Cakephp
Good Morning I need help because I am creating a form to save only dates...... the view is already created with 4 fields for dates... and there in the controller I’m half lost. I’ve debugged the…
-
0
votes1
answer61
viewshow to prevent sql Injection symfony 1.4 and Doctrine 1.2?
Hi, I have a 3 research inputs that query the database and return me the obtained data. With this a malicious user can bypass my system and get other information. Analyzing the behavior I use for…
-
0
votes1
answer209
viewsCase for several fields
I can make a query using 1 case to various fields? The fields are of the type int. If not, I can do it in php? Query select *, (case (pergunta1,pergunta2) when 1 then 'Ótimo' when 2 then 'Bom' when…
-
0
votes1
answer147
viewsDelay in massive processing of ajax Codeigniter
My code imports data from one database to another. To avoid server overload, I am importing 100 out of 100 records into each ajax. I noticed that in the first requisitions, it takes about 40ms,…
-
0
votes2
answers119
viewsHelps decrease the size of php mysql scripts
How could improve the script below, it would be possible to do something with the queries or yes thing, because it does everything I need, more became a bit messy and big, what could do? <?php…
-
0
votes1
answer363
viewsCakephp 3 - How to sum column values amount of multiple rows and display the result in the view?
I have the Table Entradaestoques id - Prod - Qtd 1 - soap - 10 2 - cloth - 7 3 - soap - 20 4 - disinfectant - 4 5 - soap - 20 6 - cloth - 3 I want to show in the View Soap: 50 units Cloth: 10 pieces…
-
0
votes0
answers39
viewsKeyword search problem, in Mysql
The problem is: How can I perform a search for results per keyword contained separately in the database? Ex: I search for "RED CARS". php executes the query "SELECT * FROM table WHERE field LIKE…
-
0
votes1
answer74
viewsTranslate Connection String H2 (JDBC) to Mysql (JDBC)
Personal talk, I’m trying to run the OW2 Orchestra software, and it comes with a standard connection string belonging to H2 in the following format:…
-
0
votes0
answers91
viewsHow to Update Mysql Database with Cache
I have a wordpress plugin of related posts, I have a table where I update the number of clicks and the number of views of each post! The problem is, on big sites I’m taking down servers with so many…
-
0
votes0
answers1146
viewsHow to create a column in a table from a Select
I have the table users and the table posts, need to copy the same information from a column of table users to a column of table posts, for example I have this code: SELECT posts.*, users.username…
-
0
votes1
answer1148
viewsUser when logging in has 2 types of menus and before that the system must understand whether it is logged in or not to display another menu
Personal in my code above, I am trying to display 2 types of menu for the user, when logged in, and not logged in, in case when logged in it still mounts another menu comparing which type of user is…
-
0
votes1
answer191
viewsCreate tables in a mysql database hosted at Locaweb
I need to add a table to my database. How do I add a table to this database hosted in Ocaweb? You must have some software or I can upload some file?
-
0
votes3
answers5404
viewsHow to create an array with Object from an SQL query
I need the following result within a variable from a query PHP + Mysql: array(1) { [0] => object(stdClass) #1 (3) { ["id"]= > string(2) "1" ["nome"] => string(5) "teste" ["email"] =>…
-
0
votes1
answer65
viewsUpdate Variable - SQL Database - Hibernate
here are excerpts from my attempt to create a real estate registration software and users. The project was developed in the MVC structure. (Model, Visualization and Control. Problem: How to update…
-
0
votes3
answers109
viewsValue is not being written to the bank
I have the following entities: package br.com.pokemax.modelo; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import…
-
0
votes1
answer1621
viewsPress button + MYSQL Database Data overwriting "Select * From table limit 18"
I want to set a button so that whenever I press the LOAD button + the limit 18 always adds +18. EXAMPLE: $sql = "SELECT * FROM portfolio ORDER BY id DESC limit 18"; CLICKABLE BUTTON $sql = "SELECT *…
-
0
votes1
answer1051
viewsMysql returns NULL when you place SUM and there are no records
I have the code SQL SELECT SUM(r.quantity_domingo) AS quantity_domingo FROM reporters AS r INNER JOIN nucleos AS n ON r.id_nucleo = n.id INNER JOIN usuarios AS u ON n.id_user = u.id WHERE…
-
0
votes0
answers448
viewsConnection refused Lockable
When I send my form, after processing the data in the save method of the Laravel the following error happens: QueryException in Connection.php line 769: SQLSTATE[HY000] [2002] Connection refused…
-
0
votes0
answers58
viewsHow to create new fields in Wordpress database?
I am developing a system style Infojobs, Catho and CEVIU in Wordpress, based on a Theme already created for this purpose. For a user to register on the site, by default of the theme, he has to…
-
0
votes0
answers50
viewsDelay when executing SQL commands
I have a system where I work with a db online hosted in Justhost.com. I suffer with the delay in executing the commands, but not always these delays exist, sometimes a command takes less than 1s and…
-
0
votes2
answers555
viewsSelect in Mysql by skipping simple quotes
Hello How can I use this select and skip value with simple quotation mark? . . .st.executeQuery("select * from tabela_A where id = uc"); rs = st.getResultSet(); while (rs.next()) { texto =…
-
0
votes1
answer726
viewsParse error: syntax error, Unexpected '='
I am mounting a connection to the database, but it returns me this error: Parse error: syntax error, Unexpected '=' in C: wamp64 www login connected.php on line 2 Code: <?php @connect =…
-
0
votes1
answer24684
viewsSelect in two tables at the same time
I have the author and sentence tables: autor: autor_id | autor_nome 1 | joão 2 | pedro frase: frase_id | frase_frases |autor_id 1 | frase do joão | 1 2 | frase do pedro | 2 3 | frase do pedro | 2 4…
-
0
votes0
answers41
viewsmysql does not respect utc date Where
I’m trying to do a query to return the records of a particular month, but mysql returns records from the previous month, example: SELECT CREATE_TIME FROM SALE_ORDER WHERE CREATE_TIME >=…
mysqlasked 7 years, 11 months ago Gustavo Emmel 596 -
0
votes2
answers365
viewsHow to change the format of a query result?
I would like to know if there is any argument in select that changes the format of result to be used as dump. Example: create table `table_name` (`id` int, `value` text); insert into `table_name`…
-
0
votes0
answers105
viewsStreamline SQL Query with Datatables
The query below returns a DataTables with approximately 400 database items Mysql. The difficulty is to return these values faster. Currently it takes on average 70 seconds to fully display the list.…
-
0
votes2
answers438
viewsHow to consult with Where and like between two tables?
Guys, I have the following problem: I have two tables, the following tables : tabela mensagens +----+-------------------+-------+---------------------+ | id | mensagem | _de | hora |…
-
0
votes0
answers30
viewsCheck expired vip users
Good afternoon, everyone, I have a classified portal and I’m putting VIP accounts on it, these accounts will have the possibility to make an amount of vip posts by the plan contracted. I already…
-
0
votes1
answer356
viewsReturn inserted value after INSERT
I have a following table: CREATE TABLE tblUser ( id INTEGER PRIMARY KEY AUTOINCREMENT, uuid VARCHAR(24) NULL, name VARCHAR(256) NULL } I’m inserting a uuid random to be a unique identifier directly…
-
0
votes1
answer63
viewsCSV file saved in the database
I have a large CVS file and I need to record it in my database the first line are the fields, which I have to validate if they are right and make some changes for example first line NAME, DATE…
-
0
votes1
answer38
viewsHelp with Mysql SQL Query
I need to select All messages sent by user 1 to user 2 and know the messages sent from user 2 to user 1. I am unable to mount the SQL query for the situation described. Message table: IdMsg,…
-
0
votes2
answers340
viewsWhy is my query not working with the php variable
I’m in trouble with my query of mysql. The value is passed from the php form correctly with the $_POST, but when I add the variable to compare the query does not send a response, but if I add the…
-
0
votes1
answer655
viewsHow to verify if a Trigger exists or not before creating it?
I intend to create a Trigger in table but first I would like to check if it already exists in my base .... how do I do ? CREATE TRIGGER IF NOT EXISTS before_update_tableX ... ect…
-
0
votes1
answer1825
viewsTrigger to update another table
I have 4 table in my Mysql database. -> companies -> contacts (company addresses) -> bank data (company’s bank data) -> members (members of the company ) All tables relate to the…
-
0
votes0
answers154
viewsDoubt in Binario Mysql Tree
Considering the tree below, I have a doubt. A B c D E F G H I J K So, I wanted to know if there is or has been any way to make a SELECT, where I bring all the IDS that are left of A. Because getting…
-
0
votes1
answer309
viewsmysqli: Couldn’t fetch mysqli_result
I want to save the result of a query in $_SESSION, but when I try to retrieve the $_SESSION, wrong "Couldn’t fetch mysqli_result". Note: I use the session_start(). Follows the code: Query mysql:…
-
0
votes1
answer45
viewsHow I select all records from the table
How do I select all records in select below: $select = "SELECT COUNT(1) AS id_mark, SUM(a.rate) AS rate, b.name_mark, b.id FROM tb_comment a, tb_mark b WHERE a.id_mark=b.id AND b.id_category=:id_c…
-
0
votes0
answers70
viewsCakephp 2.x if, Else
I have a project in Cakephp 2.x, with the following code: <?php echo $this->Form->create('Planos', array('url' => 'addPlanos')); foreach($ListarPlanos as $indice => $AdicionarPlanos):…