Posts by paulomartinhago • 1,269 points
16 posts
-
0
votes1
answer1021
viewsQ: INSERT and UPDATE in n:m relationship in Mysql
I need to create a n:m relationship in mysql, follow my example: I have a table called empresas and another representantes. An enterprise may have more than one representative, and a representative…
-
2
votes3
answers2032
viewsQ: How to relate tables in Mysql to more than one entity?
How can I relate a table(entity) to more than one entity in the Mysql database? following the following example... I have the tables: fornecedores, clientes and telefones. The fornecedores, may have…
-
4
votes1
answer1037
viewsQ: Consult ID in database ignoring scores
I have a mysql database where I need to make a comparison of registered Rgs with another provided by the user through an input, to see if the same ID is already registered in the database. The…
-
7
votes2
answers241
viewsQ: How to specify a CSS class for text that breaks line in an HTML element?
Most of the time I work with texts within elements HTML, I use a resource in CSS called line-height. Suppose the height of a specific element is 50px, so I put the line-height with 50px also so that…
-
3
votes2
answers14385
viewsQ: Payment in installments via Pagseguro
I have developed a website where there is a course for sale for a specific amount. This course is available for payment with Paying, for those who pay on the card is quiet, but would have some way…
phpasked paulomartinhago 1,269 -
6
votes1
answer889
viewsQ: Upload multiple files in PHP
I am developing an application in PHP where NF-e will be imported into the format XML. The problem is that the client will import multiple files at the same time, and I will have to take the data of…
-
6
votes1
answer1417
viewsQ: Access permissions on Laravel 4
I’m developing a system in Laravel 4 based on official Laravel tutorials and documentation. I haven’t seen anything related to access permissions (ACL) in Laravel. Knowing that my system will have…
-
19
votes4
answers35413
viewsQ: How to check events between 2 dates in Mysql?
Knowing I have a table called eventos, and this table has the columns id, titulo, inicio and fim. The columns inicio and fim are of the type timestamp, where the date and time of the start and end…
-
7
votes1
answer188
viewsA: How to recover the number of commits made by a person?
Only one command is enough to get the total commit output of all authors: git shortlog -n -s Exit: 9 paulomartinhago 1 Lucas Miguel Another way to get a result, now by Author: git shortlog -n…
gitanswered paulomartinhago 1,269 -
4
votes10
answers29077
viewsA: Scroll through an Array and check if any element is empty
You can use a array_filter php native. Take an example: <?php $entry = array( 0 => 'foo', 1 => false, 2 => -1, 3 => null, 4 => '' ); print_r(array_filter($entry)); This is the way…
-
41
votes6
answers98339
viewsA: How do I undo the last commit in Git?
You can do it this way when you eliminate the activities done in the Stage: git reset HEAD~1 --hard or to return to activities: git reset HEAD~1 --soft…
-
3
votes7
answers31206
viewsA: How to insert data into DB with jQuery/Javascript without using PHP?
You can work with data on Mysql using the Node.js which is a Javascript on server side. There is a very big fight between the PHP and Node.js on various performance issues. There you go from…
-
2
votes7
answers6727
viewsA: In object orientation, why are interfaces useful?
We should use the interface language construction, when we need to define the behavior of a family of objects, which have no common implementation. For example, we need to define a family of eternal…
-
3
votes10
answers68840
viewsA: How to make a <div> occupy the entire page width but leave a gap of a few pixels on each side in CSS?
There is a quiet way to do this, using only CSS with the box-Sizing property. Take the example: #header { height: 70px; width: 100%; padding: 0 5px; box-sizing:border-box; -ms-box-sizing:border-box;…
-
0
votes4
answers20996
viewsA: Difference between null, Empty, 0 and false
The Empty it would not be like a "space", because then it would be an empty string. The Empty is when a variable exists, but with no defined value for it. Example: $variavel = ""; // Ela existe,…
-
1
votes2
answers809
viewsA: How to load a view into a layout?
To include sub-views within the layout, it can be this way: @include('view.name') Passing values: @include('view.name', array('some'=>'data'))…