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
answers32
viewsData repeats instead of null
People do not know if this is normal in sql but I will post here to clear my doubt. I have a query with three tables using INNER JOIN, apparently the result is favorable, but a small detail bothers…
mysqlasked 6 years, 8 months ago Stênio Barroso de Moraes 312 -
0
votes1
answer478
viewsChange Login button to logout
First of all I want to warn you that I am a beginner in PHP and I appreciate help because I need to deliver a work and I am in Deadline I have a login button and I want you to switch to logout when…
-
0
votes1
answer82
viewsInsert two checkbox in different fields in mysql
I have this code that creates this table with the first two fields already filled in pattern: <?php $result_cursos = "SELECT nome, Quarto FROM centrodb.utentes WHERE descricaovalencia = 'LAR' AND…
-
0
votes1
answer21
viewsHelp with SQL query
I have 3 tables: enterprise: id integer nome string category: id integer idEmpresa integer nome string tag: id integer idEmpresa integer nome string I am consulting as follows: SELECT…
-
0
votes1
answer174
viewsHow to translate this query to Codeigniter query Builder?
I’m having difficulties to assemble this query in Codeigniter, someone can give a little help? select venda_itens.secao, venda_itens.secao_nome, sum(venda_itens.qtd_itens_finalizada) as qtd_itens,…
-
0
votes1
answer50
viewsMysql query with AJAX
I created a table "usuario" in the MySQL containing name and password. I have established a connection with the PHP and I would like to consult on AJAX, to validate this name and password and print…
-
0
votes0
answers37
viewsDoubt about Session()
I have a question about the use of sectionals. I’m building a dynamic query system to get data from my database when I click on a link, each link passes an id through the URL. On the page where the…
-
0
votes2
answers78
viewsProblem with Login
I’m trying to create a basic login, with verification so that there are no records with even users in the database. But I’m making a mistake on this line $row = $resulta->fetch_assoc(); Fatal…
-
0
votes0
answers42
viewsDo not save Array of value 0 in the database
Guys, I have a form with 'n' quantities of inputs, all with the same structure: echo "<input name='quantidade[]' type='number'>"; When I finish the form and send it to the next page, they come…
-
0
votes1
answer42
viewsMysql conditional average (avg)
I have the following table userid--state-----fraction 589-----wrong---0,0 589-----wright---1,0 589-----wright---1,0 589-----wrong---0,0 589-----wrong---0,0 589-----wrong---0,0 589-----wrong---0,0…
mysqlasked 6 years, 7 months ago Miguel Silva 491 -
0
votes2
answers170
viewsProblem passing variable from one screen to another
Here’s the deal. I have a problem using $_SESSION in PHP. I’m starting now, so excuse me if I haven’t done the login system the right way. I have a login screen that basically runs this code:…
-
0
votes2
answers56
viewsCount Database output
hello. good night. I have a question I want to add up all the field values valor_reais of my table for example id 1 = 150 id 2 = 100 id 3 = 100 I want the obvious result, 350 I’ve tried something…
-
0
votes1
answer523
viewsOrganize HTML table data - CSS - SQL
I have the following code <table border="1"> <?php $sql = $mysql->prepare("SELECT id FROM usuarios WHERE status = 0"); $sql->execute(); $sql->bind_result($id);…
-
0
votes2
answers67
viewsjQuery bring value from Mysql table
I’m setting up a music list register for a karaoke site. It works like this: Search for pre-registered music Take this song from input and insert it into a li list I have the following: <input…
-
0
votes1
answer88
viewsCheck if date and time/minute has already expired
I’m having a problem, when I upload my site to PHP 5.6 the code I use to check if such a date and such an hour/minute expired is simply not respecting the time, if it is the date already says that…
-
0
votes1
answer57
viewsShow only those that are not common between two querys in mysql
I have this first query that only shows the names with the current day registration date: SELECT nome, centrodb.registoMiDe.Quarto, DataRegisto, Miccao, Tipo1, Dejeccao, Tipo FROM centrodb.utentes…
-
0
votes3
answers99
viewsTake data that is not in the table
In Mysql I have a table login, that shows who logged on to the system: id | cod_usuario After the site is ready and running the client passed me a list of cod_usuario that CAN log into the system,…
mysqlasked 6 years, 7 months ago caiocafardo 1,897 -
0
votes0
answers100
viewsMysql - Recursive query between two tables
Situation: Given the profile table (Figure 01), which describes the number, type and year of the questions (Figure 02) for the questionnaire (Figure 03), bring q amount of questions, and the…
-
0
votes2
answers92
viewsDelete duplicate records in MYSQL
I am using a command that runs every second in Node.js. It has the function of deleting any record in duplicity for a particular item, which is specified as in the example by AND t1.auction_id =…
-
0
votes0
answers667
viewsExport query to CSV file with PHP
I have a PHP code that does a query in the database and was to return the values to a CSV file, but this is not happening. The script is even returning the query, but the values are only in the…
-
0
votes1
answer294
viewsInsert XML into Mysql table
I have an xml with the name of some movies, I want when I press a button in html the names are inserted in a table in the database. I made the connection to php using ajax. The problem is that when…
-
0
votes1
answer245
viewsInner Join is returning repeated results
I have three tables! One of them is a relation table! Are they: Person: Treating: Relationship Table between Person and Treatment: I would like that when passing the person’s ID, the query returns…
-
0
votes1
answer116
viewsphp foreach Multilevel menu
Hello friends all right ? I am with the following problem I have this database need to create a menu with Multilevel for the blog site, created one with the following code: <ul class="nav…
-
0
votes0
answers52
viewsHow to add the value of an id_UsuarioLog to a FK?
Hello... Well, supposing a user wants to comment on any post. The system should: Check if the user is logged in, otherwise he will receive a script "you must be logged in to comment". If the user is…
-
0
votes1
answer46
viewsTrouble joining tables with UNION
I am trying to bring the top 3 of my table and also the last 2 placed, SITE TO EXECUTE SCRIPT This is my current progress that doesn’t work SELECT ('Podium: ' ||TEAM) as name FROM LEAGUE ORDER BY…
-
0
votes1
answer811
viewsERROR 1215: Cannot add Foreign key Constraint (Mysql Workbench)
Hello I am trying to add a foreign key to a table but I get error 1215. I have already checked the attributes and all are compatible, the portfolio field is a primary key, I do not understand why it…
-
0
votes1
answer176
viewsPHP PDO transaction with multiple objects
The idea would be this: I have 3 classes, one for connection to the bank, another for Users and another for Product. The User class with the database tb_usuarios. The Product class with the database…
-
0
votes2
answers85
viewshow to return the last timestamp date by doing group by of the same id in mysql
I have a problem I have a table that has the serial column, equipment and a data timestamp has no primary key because this table would be a history, I in the table have several lines with the same…
-
0
votes1
answer114
viewsDifficulty in While Loops and Foreach
I’ve been studying php for a little while so I didn’t properly understand the structure of the loops as while and foreach I would like someone to explain to me why this while displays nothing, and…
-
0
votes1
answer87
viewsBank modeling with classes with n relationship for n
Galera Good morning. I’m modeling a company that owns several branches. Basically I have information, of size, of the organization chart of each size, and of positions in the branches. For example…
-
0
votes1
answer68
viewsError when trying to enter form in the authenticated user’s Language (foreign key to another table)
I am trying to enter the data of a form of a class Condominium with the user already logged in and authenticated , user_id is foreign key to the table Condominium, in my understanding the store…
-
0
votes1
answer108
viewsInserts blank lines when inserting foreach
I am entering in the same column all the data of my form, which contains checkboxes and inputs type="number": $calendar .= "<td bgcolor='#F5F5F5' align='center'…
-
0
votes1
answer44
viewsAger loading and custom queries
This question is a follow up of this and of this. But I’ll try to make them independent. I have the following tables, weathers: +--------+-------+---------+ | id | temp | id_freg |…
-
0
votes1
answer117
viewsWhat way can I validate current time
How could develop routine [code block], in order to treat the text field where to insert the Hours in real time (Current time, resulting at the moment). In case the user tries to add hours past -…
-
0
votes2
answers123
viewsHow to make logic enable text field at a time when filled
How should I proceed with logic? There is a Data Registration Form on the page, to know: Name Surname Age Cellular I need to leave these fields as follows: 1- When the tab is loaded the field…
-
0
votes2
answers90
views -
0
votes1
answer416
viewsMake datepicker date range to be used in mysql
In my code, I have a calendar where the user selects the period he wants to analyze. The code is this: <input type="text" name="daterange" value="01/01/2012 - 20/04/2018" /> <script…
-
0
votes1
answer60
viewsReturn multiple elements by ajax
My question is this, I have a table on MySQL with id, pesquisa and data. I want to give a select in this table on php and return by ajax so that I can insert each element into a td specific within a…
-
0
votes4
answers72
viewsShow login user column sum. error
Good morning, everyone, help me? i do not understand much of php, but for me to finish my site missing only one thing: I need to post the sum of the values that are in the table but based on the…
-
0
votes1
answer371
viewsGoogle Chart, PHP and Ajax - Pie chart does not show
I’m not able to plot the Chart pie from google Chart. When I change the type of chart to Barchart or columnchart, it plots, but when I put piechart it does not divide. File that takes data from BD…
-
0
votes1
answer262
viewsMysql - Clause problem WHERE `column` != NULL [BUG? ]
I came across the following problem: In my application I have a function that checks whether some value is already in use in another record, soon I must pass the id of the current record to delete…
-
0
votes1
answer122
viewsDifficulty listing a invoice and products using PHP and Mysql
I’m having trouble with this page right below. My difficulty is in displaying the products of a specific invoice. Because in statment SELECT * FROM produtos WHERE = ? does not return anything! But…
-
0
votes0
answers98
viewsHow to search user login to search data in database?
Good evening, everyone, I am using this command line, it worked perfectly with me typing the login of the person, but when I try to put to go based on the 'user_login' (logged in user) it does not…
-
0
votes0
answers186
viewsHow to update a table using mysql c# and a method?
You can use a method or class that uses table fields to update this table? For example: update record field 1 with f(record field 2 1), record field 1 with f(record field 2), etc...…
-
0
votes1
answer99
viewsOrder taking only the last registered product
I am creating a simple system to make order reservations, where I bring the products from the database through a simple while, but if I try to put brackets in my Ames, example name=name[] it brings…
-
0
votes1
answer1129
viewsMysql Workbench access denied
Good afternoon, I am having problems in mysql Workbench, is giving permission denied, but when I enter the terminal as superuser I get access. (image access denied on Workbench) (Terminal access…
-
0
votes1
answer393
viewsConsultation of a date between two dates
I needed to consult if a certain date is contained in a date range. Being more specific, in a vehicle control system we have, when we receive a fine, we need to identify the driver who was with a…
-
0
votes2
answers402
viewsSUBSTRING_INDEX in mysql
I have these values in the table of the database, where in the field array the comma separates as if it were a column. The data is this way: Id------arrachar 1…
-
0
votes2
answers92
views -
0
votes1
answer20
viewsSQL query with OR gets slow
I have an appointment that does the search using: WHERE pt.product_name LIKE '%termo da busca%' Then I want the search also look for the artist’s name and put: WHERE pt.product_name LIKE '%termo da…