Questions tagged as 'mysql'

2
answers

Invalid argument foreach () return blank message

<table border="1"> <?php foreach($arrayReturn['qsa'] as $value){ ?> <tr> <td>NOME:</td> <td><?=$value['qual'];?></td> <td><?=$val...
asked by 07.08.2017 / 23:10
3
answers

Multiple foreign keys in a single query

Well, I'm having some problems creating a mysql query that looks for several data from several tables in a single query, I looked here in the stack, I found some similar questions, but I could not understand the logic or method used, and or "why?...
asked by 26.07.2017 / 15:50
3
answers

How to do a query in a date range in mysql? [duplicate]

I want to make a comparison if the date is within 30 days. For example, I have the date 10/01/2016 and I want it to return all the results with dates 30 days close to that for example, 09/02/2016.     
asked by 02.09.2016 / 02:09
3
answers

Get the first 3 results in a mysql_query query

I'm retrieving data from the database that would be "The Indicator of the Indicated", but it catches all up to retrieve all. What I need to do is get only the first 3 results. And if I tell you how many results I want to get, that is, set thi...
asked by 15.01.2016 / 03:43
1
answer

Extract name and last name mysql

Good morning Guys, how do I extract the name and last name of a record. However, it should return the first and last name when it has only one last name. My table is like this.    table = 'users'; field1 = 'name';   field2 = 'sobronome';...
asked by 02.06.2016 / 15:43
1
answer

Stock Control

I'm developing a shopping cart ... I arrived in a party that ended up going wrong ... following the cart consists of additional product revenue and removal of ingredients tabela produtos id nome id_lanche preço 1 X-egg...
asked by 25.09.2014 / 10:02
2
answers

Group table data with two columns

Well, I'm in an incognita I'd like to solve directly in the SQL query, see this supposed example: TIPO | DE | IDENTIFICADOR ------------------------- 001 | 23 | 9 001 | 44 | 9 001 | 23 | 8 002 | 11 | 11 I want to group the data in ord...
asked by 15.11.2016 / 22:00
2
answers

MySQL DATE type is shown as DATETIME in a datagrid

I create a very simple database with the following command: CREATE TABLE IF NOT EXISTS 'ABC'.'Socio' ( 'idSocio' INT NOT NULL, 'SocioNome' VARCHAR(45) NULL, 'SocioDataNasc' DATE NULL, PRIMARY KEY ('idSocio')) ENGINE = InnoD...
asked by 09.11.2016 / 22:31
2
answers

Check if the same value is in any of the two fields

In a login system, I want the user to type the "user" or "email" that is contained in the DB. This works perfectly: DBRead('usuarios', "WHERE usuario = '$user' OR email ='$user' AND senha = '$password'"); However, I hate repeating code...
asked by 06.11.2016 / 15:25
2
answers

Help with mysql curdate () - 1

I'm getting this error:    # 1064 - You have an error in your SQL syntax; I have tried it in many ways, but it always gives this error. Here are two of my attempts: SELECT 'category'. * , 'event'. * FROM category, event WHERE 'categ...
asked by 23.11.2016 / 16:05