Posts by Eduardo Xavier • 560 points
16 posts
-
0
votes3
answers14615
viewsA: How to remove a Foreign key in mysql?
Try to fix it, or give up and give another solution... Attempted correction DELIMITER \\ SET FOREIGN_KEY_CHECKS=0\\ ALTER TABLE tabela DROP FOREIGN KEY nomefk\\ SET FOREIGN_KEY_CHECKS=1\\ DELIMITER…
-
1
votes1
answer62
viewsA: SQL execution pouch while executing another program in transaction
It’s unclear if you’re committing or rollback on the transaction. It may be that the file is in lock and then the other system, in this case the visual studio, is not able to access. Try using the…
-
3
votes1
answer205
viewsA: Duplicate record in the database
You will need to fulfill a series of steps. Create a temporary table named news_tmp Make a SELECT DISTINCT in the news table to take only one record and ignore duplicates. In select, put the columns…
-
1
votes2
answers58
viewsA: Exception Handling at MODEL
If you find a problem with the model, you can send an Alert like this: public ActionResult Create(ItemModel fvm){ try { } catch (Exception e) { TempData["msg"] = "<script>alert('Olá…
-
1
votes1
answer61
viewsA: Specification? What is the best term?
Yeah, no problem at all. The term "specifications" is usually a reduction of the term "requirements specifications". And requirements specifications have to do with description of activities that…
-
9
votes2
answers4577
viewsA: DRY is to avoid redundancies, right?
Look, DRY is a philosophical principle about avoiding duplication of logic here and there. There are many discussions on what is duplication or not and how far it is worthwhile to avoid duplication,…
-
2
votes2
answers75
viewsA: Format only last characters of a column’s values in Mysql
I saw an answer guiding use locate() and I’m sure SUBSTRING_INDEX is more appropriate. locate() seeks the first occurrence of an extension identifier, the ponto. but if the file has another extra…
mysqlanswered Eduardo Xavier 560 -
1
votes2
answers587
viewsA: Sort by the result of the sum of two SUM - MYSQL
To do summation ordering you do not need to create Queries no. Queries like this, they work well: select ID, SUM(QUANTIDADE_A), SUM(QUANTIDADE_B), SUM(QUANTIDADE_A + QUANTIDADE_B) AS TOTAL from…
-
1
votes2
answers217
viewsA: Go back to the previous Fragment by clicking the Back Phone button?
In fact the user should use the: getFragmentManager(). popBackStack() Sort of like this: @Override public void onBackPressed(){ FragmentManager fm = getFragmentManager(); if…
-
1
votes2
answers115
viewsA: How do I call two models in one view?
You said you have a view to consult books and you have a "BOOK" model. This means that your "model" book relates to your database, BOOK should also be your table. So your model is your database…
-
2
votes1
answer3143
viewsA: What to do to call a function from another controller in Laravel? I would like to implement best practice
I agree with @Andersoncarloswoss positioning. You should implement using another structure. I will extend his argument; the controllers in MVC can be a kind of service or Façade.. because they can…
-
2
votes1
answer137
viewsA: How to save the checkbox value by choosing only one of these?
Make explicit the form configuration with action="post". Make sure the tags html name="escolaridade[]" be the same thing you want in $_POST. Example, if name="escolaridade" use…
phpanswered Eduardo Xavier 560 -
1
votes1
answer125
viewsA: Jsonobjectrequest does not enter onResponse()
Dude, First of all, this code is mega confusing. You are mounting an instance of the Jsonobjectrequest object by passing in the last parameter a Listener - which is a class that has a behavior that…
-
2
votes2
answers285
viewsA: Detect generated event in another class
Friend, In the comments you complain about the event denting in an infinite loop and in your question you have the following passage: "if time breaks it returns an event content with a string with…
-
8
votes1
answer365
viewsA: What is the benefit and in what cases use closures in PHP?
Marcelo, In my experience with javascript and c# I could say that Clousure is used to explore aspects of scope and context. In javascript and other languages that allow us to be event-oriented (like…
-
3
votes1
answer560
viewsA: Response.Write/Flush hangs after many calls
Conrad, I think you may have already solved the problem but worth the reflection. I found your solution very clever and do not understand why the flush is giving problem. I don’t think a 3MB file is…