Questions tagged as 'mysql'

1
answer

mysql error code 1111. invalid use of group function

I tried to use the following query in my database: SELECT MAX(COUNT(DISTINCT c.unique_carrier)) FROM companhia_aerea c, avioes4 a, ponte2 v WHERE c.unique_carrier = a.UniqueCarrier AND a.TailNumber = v.TailNumb AND V.DepDelay > 0; This q...
asked by 15.08.2015 / 15:53
1
answer

Update mysql table with image

I am trying to upload an image however the table is not updated. already utilizei var_dump($arquivo) and return is correct, with filename + extension. The code is in the header of my page and the form has no action, when I click on sen...
asked by 06.08.2015 / 16:39
1
answer

Create trigger MySql increment / decrement attribute

I have the following tables -> app(id_app, nome_app) -> category(id_category, nome_category, total_apps) -> app_category(id_app_fk, id_category_fk) What I want to do is that whenever I add data to the table "app_category" it checks...
asked by 05.08.2015 / 02:49
1
answer

Insert into a different model table in CakePHP 2.x

I'm making a site with a buddy cart, with CakePHP 2.x . I created a statistics table, I made the model of it all right but I'll insert it into it, only when I go into the detail of some product. When I enter the product detail I want...
asked by 08.08.2015 / 21:25
2
answers

Problems with insert logic

I have a problem. I'm doing an event access control system, I created a table that records the given id, code, date, time, sit, the sit field will be 1 and 2, but I need my system to understand the following. When the last record of the bank is...
asked by 11.09.2015 / 19:54
1
answer

CRUD error with .NET MVC

I'm trying to recover some data from my bank, but it's giving the following error    Specified key was too long; max key length is 767 bytes I have no idea what's going on. User Class public class Usuario { [Key] public...
asked by 10.09.2015 / 21:13
1
answer

Mysql - check occurrence in all fields

How to check the occurrence of a string in any field? Nothing specific like WHERE campo1 = "abcd" , since I want to check the occurrence in any field. That is something different also from the extensive OR, to sweep each field, somet...
asked by 11.09.2015 / 21:07
3
answers

Insert image into 2 different tables [duplicate]

I created a function to register images as if it were an album; A table for capa and a table for galeria . HTML: //Imagem da Capa <div class="form-group"> <label class="col-md-1 control-label" for="capa">Capa...
asked by 11.09.2015 / 17:36
2
answers

file download in mysql

I have files in my database that I would like to make available for download. These files are of several extensions; .pdf, .txt, doc, .xlxs and etc; I searched in a lot of places but did not find anything detailed (for beginners). I want t...
asked by 22.07.2015 / 17:31
2
answers

Sort result using CASE and BETWEEN

In the first code just below, I can list right the freight price of the transports table via the range of cep and peso , however I'm having a problem, I need to sort the result according to zip sent, depending on the query is fallin...
asked by 22.07.2015 / 04:32