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
-
2
votes3
answers2007
viewsSelect records from a table where the record of a related table is a specific value
I have a table of technical calls and a table of appointments. Each 'CALL' has several 'CALLS' and it is in the calls that is the field that defines the status of the call (Open, Closed, In…
mysql codeigniter select relational-model active-recordasked 10 years, 8 months ago EdnaldoNeimeg 109 -
2
votes3
answers1760
viewsPerformance issues using UPDATE
I am building an import application that takes the lines of a txt file and updates it into two tables, works normally, however the files usually have more than 5 thousand lines, and I am not being…
-
2
votes1
answer259
viewsHow to pass an SQL expression for an UPDATE to Zend?
My Mysql DBMS has a table called elements where one of the fields is called posicao and is like int (6). I need to update (SQL) where the field posicao shall be updated with its own value by…
-
2
votes1
answer474
viewsIs there an alternative way to use foreign keys in Myisam tables?
I’m making an application and need to relate two tables, logically, could use foreign keys... The problem is that the database I am using only allows Myisam tables that do not support foreign keys…
mysqlasked 10 years, 8 months ago user3174 -
2
votes1
answer174
viewsSorting data from one column to another
I am setting up a hierarchy and everything is working correctly, I just have a small problem, in the ordering of the data. Follows the structure of the table. (as basic as possible) create table…
-
2
votes2
answers1836
viewsDuplicate column value, how to avoid?
How exactly do I get this column valueAuxilio does not have its values duplicated, that is, instead of four result lines would be only two. SELECT p.nome, d.nome, c.valorAuxilio FROM sca_pessoa p…
-
2
votes2
answers293
viewsSort by date in Mysql
I have a table with two fields: dh_premium_expires and score. dh_premium_expires - the date/time the user premium will expire. score - score of the user within the game. On my site I have a list…
-
2
votes1
answer1183
viewsHow to compare the value of numbers saved as VARCHAR in mysql?
I have a table called coordenadas_cache, with 6 fields: codigo (int, auto increment), latitude_sul (VARCHAR(10)), latitude_norte (VARCHAR(10)), longitude_oeste (VARCHAR(11)), longitude_leste…
-
2
votes2
answers2851
views -
2
votes1
answer118
viewsMysql event to block user with x denunciations
I have a table of complaints where I record the information of users who reported and who they reported id | user | denunciado 1 | userx | userY 2 | userz | userY and so on, now I would like to do a…
-
2
votes1
answer155
viewsAccess dated folder by VM
My scenario is this:: /media/data/svr/mysql Where is my dated mysql folder located. The development environment is running on Vagrant (debian 6), with php 53 and mysql 5.5 I configured the VM to…
-
2
votes3
answers33562
viewsUpdate records from one table using values from another table
I need to update a table with the value of another table and there are many records so why I’m doing it this way, but my query is not working: UPDATE produtos SET produtos.fornecedor =…
mysqlasked 10 years, 6 months ago Silvio Andorinha 8,394 -
2
votes2
answers19537
viewsDelete record by ID
I created a button to delete a record in the database with the following code: Filing cabinet form.php: <form action='deletar.php' method='post'> <input type='submit' name='deletar'…
-
2
votes2
answers793
viewsCalculate total days worked in a given month
I have a problem creating a system in PHP/Mysql. I have a form in which I need to insert: Name of Official Date signed on duty Date of Departure Usually it happens something like in the example: the…
-
2
votes2
answers707
viewsQuery Mysql returns no error or result
I have five tables in which each one of them has data that I need to be displayed grouped by date. Proposals are grouped by date, number of proposals, value of proposals, media, amount invested,…
-
2
votes1
answer2194
viewsHow to show the number of views of each page of the site with PHP?
In my database in the table paginas I have the fields pagina_1, pagina_2 and pagina_3 representing the three pages of my website. In these fields I will insert the page views as below. In the code…
-
2
votes1
answer100
viewsGenerate a table from another 5
I need help to build a query that brings data from 5 other tables. I will try to be as clear as possible, in case information is lacking, please inform me. Come on: I have the Midias table:…
-
2
votes2
answers3257
viewsLogin with PHP + MYSQL +MD5
I created a login form with the following code: Login.html: <form action="login.php" method="post"> <input type="hidden" name="id" value=''> Usuário<input type="text" name="usuario"…
-
2
votes1
answer2703
viewsWhat are the recommended values for Mysql database (id, user, password and email)?
I created a table user with the following values: Tipo = `MyISAM` ID = `int, PRIMARY, AI`; Usuário = `varchar, 16`; Senha = `varchar, 16`; Email = `varchar, 100`; Are these values recommended?…
-
2
votes2
answers2139
views -
2
votes1
answer497
views -
2
votes1
answer71
viewsSafe Updates in Phpmyadmin
In Mysql Workbench has a very useful function called: "Safe Updates", which prevents Updates in a column without WHERE, for example. In Phpmyadmin, is there this function? I could not find.…
-
2
votes2
answers1625
viewsHow to make an empty select to pull all results from column
I’m trying to make an empty select, which if no option selected pulls all the results, using the AND in the SELECT form forces me to choose some option, how can I resolve this? Follows the codes:…
-
2
votes1
answer1455
viewsMysql time tables
I am here studying the temporary tables of Mysql, and I am creating some temporary tables. I am using the mysqli, according to the manual, the temporary tables are erased after the connection is…
-
2
votes2
answers888
viewsFormat date (from a txt file) to Insert to Mysql
Follows the code: //informações necessarias para inserir no DB. coo := copy(lTemp,53,6); ccf := copy(lTemp,47,6); ecf := copy(lTemp,4,20); //Data sendo formatada para ser inserida dtc1:=…
-
2
votes2
answers8216
viewsHow to use While in MYSQL
How to use WHILE in Mysql? I tried with the following expression: set @C = 5 while @C > 1 select dia from base_prov_chamada end while; And I got the following reply:: You have an error in your…
mysqlasked 10 years, 5 months ago Daniel Nure 21 -
2
votes2
answers504
views -
2
votes2
answers538
viewsConcatenate array of selected checkboxes to use as a search filter
I have a search with several checkboxes that can be selected and added dynamically by the user. Since I don’t know the amount, I was thinking of doing the following: go through all of them and…
-
2
votes1
answer1379
viewsSelect a Mysql table inside a PHP file without refresh
Select Mysql database data inside a PHP file without refresh. Example: <?php // Essa select abaixo tem que buscar a cada 5 segundos sem atualizar a página $selecionaTabela = mysql_query("SELECT *…
-
2
votes1
answer282
viewsExport Excel PHP Workbench Variable data
I’m having doubts regarding generating an excel with the query. <?php include("conectar.php"); $id = $_GET['id']; $arquivo = 'Não autorizado .xls'; First question is this: In the $file part I can…
-
2
votes1
answer185
viewsYou have an error in your SQL syntax;
I’ve been using this code for a while now that you’ve made this mistake Error: Database Select Failed: You have an error in your SQL syntax; check the manual that Corresponds to your Mysql server…
-
2
votes2
answers7712
viewsHow to import data from a txt to Mysql with php?
How to import data from a txt for Mysql with PHP? Explanation: I need to read a txt take all the data and insert it into mysql in a string that at zero position has a four-digit code and at eleven…
-
2
votes1
answer96
viewsFilter first result
Have some way to filter in php the first result of a query ? Example: $query = mysql_query("SELECT * FROM teste2 ORDER BY 'id' DESC") or die(mysql_error()); while ($row = mysql_fetch_array($query))…
-
2
votes2
answers13368
viewsNumber of "bound variables" does not match the number of "tokens"
I made some changes to the script and is generating two errors: Warning: Pdostatement::execute() [pdostatement.execute]: SQLSTATE[HY093]: Invalid Parameter number: number of bound variables does not…
-
2
votes2
answers474
viewsMount query for database query according to checks marked
I have the following situation, the user can select the language level, as: Basic, Intermediate or Advanced and I have it in checkbox form. I need to assemble a dynamic query according to the or…
-
2
votes4
answers430
viewsPHP class for interaction with Mysql BD
Does anyone know any PHP class for Mysql integration, using the function mysqli_* and Prepared statements? I have these two examples: Mysqlidb Mysqli Database…
-
2
votes1
answer1196
viewsSELECT command denied to user
Error: SELECT command denied to user 'banco'@'xxx.xx.xx.xx' for table 'table' This error only happens in my hosting, is running site perfectly, I am consulting 2 databases in a single query using:…
-
2
votes0
answers340
viewsOperation not applicable Delphi Clientdataset
Why am I getting the bug Operation not applicable when I open a TClientDataset with data master-detail, but it is only one dataset and a detail. System mode : Datasnap > on qryPai/dspPai/dsPai…
-
2
votes0
answers52
viewsHow do I get the column names of a table with PHP?
I would like to take the name (only the name) of a specific Mysql table and display with PHP.
-
2
votes1
answer8935
viewsProblem persisting: "Cannot add or update a Child Row: a Foreign key Constraint fails..."
Tables Contact CREATE TABLE IF NOT EXISTS `sgct-database1`.`contato` ( `contato_id` SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT, `telefone` CHAR(10) NOT NULL, `celular` CHAR(11) NULL, PRIMARY KEY…
-
2
votes1
answer849
viewsData conversion in types such as int and double
I’m having trouble making data conversions from a database, for example I perform a query to the bank like this: carteira ca = bc.carteira.FirstOrDefault(obj => obj.cpf == cepf &&…
-
2
votes3
answers2000
viewsPass checkbox list to php
As I can pass to a php page a checkbox list selected, I have this that shows me the checkbox, but I’m having trouble sending them to php. function SelecionaChecks() { var Check =…
-
2
votes1
answer129
viewsProblem with mounting SQL query
I have a table of "disciplines", a table of "students" and a table of "students" where these students may be enrolled in one or more disciplines. These disciplines are shown as checkboxes on the…
-
2
votes2
answers192
viewsRemove from account when value is 0
I have the following query: SELECT ROUND((( notaAmbiente + notaApresentacaoDasPizzas + notaQualidadeDosProdutos + notaVariedadeDeSabores + notaAtendimentoNaLoja + notaAtendimentoNoTel +…
-
2
votes1
answer64
viewsSearch all records for a respective year and month
In my BD I have the date field of type date (YYYY-mm-dd). What happens is I want to fetch all the records for a given year and month. For example, I want to get all the records for 2014 of the month…
-
2
votes1
answer74
viewsFailure to popular a gridView
I am having problems when displaying a gridView, it is not displaying the right data, it seems that this trying to display vertically, I have already changed the property Gridline to horizontal,…
-
2
votes2
answers81
viewswhich SQL command would display records where the Lastname field is "Duck" and the date in the Birthdate field is greater than 01/01/1950?
Considering the table, which SQL command would display the records where the Lastname field is "Duck" and the date in the Birthdate field is greater than 01/01/1950?…
-
2
votes1
answer702
viewsCommand to display a record limit in a table
Supposing that a database have a table locacoes, which SQL command would display between the tenth and twentieth record of this table, ordered by the field titulo?…
-
2
votes2
answers915
viewsHow do I use Mysql Federated?
I need to use the FEDERATED Engine in my Mysql database but by default it is disabled, in some forums it says that to enable it is necessary to go to my.ini configuration file and add the Federated…
-
2
votes1
answer320
viewsMysqli SUM query does not return result
I am trying to sum up a column using the mysqli SUM method. The problem is that my query does not return results. My code is this: $sql = 'SELECT SUM(size) as soma, porta FROM `'…