Posts by Ivan Ferrer • 12,096 points
772 posts
-
3
votes3
answers4229
viewsA: Check the running time of a Javascript function
You can capture the start time of your method and remove the time that has passed from the current time until the end of the execution: function seuMetodo() { var start = new Date(); for (var i=0;…
-
2
votes2
answers219
viewsA: Stop loop in function inside another
I don’t understand what’s wrong with your code, but to stop the loop, you can use: break; or return your method with return;.
node.jsanswered Ivan Ferrer 12,096 -
0
votes3
answers215
viewsA: Leave current page highlighted in a page selection menu?
You can check if the current page is the content page you opened, the "active" class is printed. Example: <li role="presentation"<?php echo ($page == 'dashboard') ? ' class="active"' : ''…
-
0
votes1
answer861
viewsQ: Export Mysql database data to Excel
I am running a post that send a string with all titles and fields of a database, but it only exports when I send up to 4 months. I wish I could send up to 1 year, how could I improve the code below…
-
1
votes3
answers642
viewsA: Undefined variable error occurs when using classes
You have ignored the Object’s inheritance rules in this case, as you can only call a PDO method through your class only after it is instantiated within it. Also check the private and public methods…
phpanswered Ivan Ferrer 12,096 -
0
votes2
answers501
viewsA: import 1.2GB Mysql database
I already managed to solve the problem. In fact I had given a stick at the time of processing by the terminal and was in an infinite execution... I exported it to Mysql Workbench and it all worked…
mysqlanswered Ivan Ferrer 12,096 -
0
votes3
answers561
viewsA: Search multiple Mysql tables
I would do it this way: SELECT c.*, ct.*, cip.*, mac.*, pppoe.* FROM cliente c LEFT JOIN cliente_contato ct ON (ct.id_cliente=c.id) LEFT JOIN cliente_ip cip ON (cip.id_cliente=cip.id) LEFT JOIN…
-
1
votes3
answers5089
viewsA: How to pass a json containing data array to Php?
Try using the jQuery library: <script type="text/javascript" src="https://code.jquery.com/jquery-latest.js"> </script> <script type="text/javascript"> $(document).ready(function()…
-
0
votes3
answers472
viewsA: Ignore certain values in Mysql
To optimize, you can use PDO and create methods to execute your query. I didn’t get it right, if you want to display the status total, or if you want to display each of the status. But if to show…
-
0
votes2
answers4299
viewsA: Picking attributes from an object using jQuery
When accessing attributes, consider that the element is accessed as follows: By class(s): '.nome_classe1, .nome_classe_2' By Id(s): '#elem_1, #elem_2' Per element(s): 'body, html, div' Pass the list…
-
-1
votes1
answer82
viewsQ: GIT command to delete the last log without affecting the current version
I would like to delete the last commit log that I did, the commit log that’s there is from a file that I deleted, but I don’t want it to be in versioning, which git command I need to do for it?…
-
3
votes4
answers2045
viewsA: How to limit PHP words
You can do this in a simple way: echo substr($row['title'],0,26).'...'; ?> Methodically: function limitChars($text, $limit=20) { return substr($text, $limit).'...'; } echo…
-
2
votes2
answers450
viewsA: Pictures above the carousel
You are using the parameter z-index:-1 in class .active in your css. This causes the active object to fall below everything.
-
1
votes1
answer626
viewsA: Add and remove favorite items with php Session and ajax
From what I understand you want to know how to make a shopping basket, so I suggest you do something like this: session_start(); class Imoveis { private $favorites = []; public function…
-
1
votes2
answers757
viewsA: How to deploy with Wordpress
You can do this through an online account, with the Github or the Bitbucket. This video guides how to do. First create the versioning of your project on your machine and then clone your project on…
-
-1
votes4
answers7700
viewsA: Sort a multidimensional array by a column, keeping the same lines of the array
Try to use the method array_map(): $data = array( 'sites' => $lista_estacoes, 'IPs' => $lista_enderecos ); $new_data = array_map($data['sites'], $data['IPs']); usort($new_data);…
-
-1
votes3
answers387
viewsA: How does semantics/indexing work with Angularjs?
One tip I can give you is, take the course they offer, it’s fast and easy, you’ll understand better how semantics works: http://campus.codeschool.com/courses/shaping-up-with-angular-js/…
-
0
votes4
answers1290
viewsA: How to bring a specific result of an SQL query above the others?
You can also use an order for the desired field and values using the following rule: SELECT DISTINCT `user_id` AS `id`, `user_name` AS `name` FROM `users` ORDER BY FIELD (id, 3, 1, 2, 4 ) ASC, id…
-
1
votes2
answers1046
viewsA: Use LIMIT together with LEFT JOIN in more than one table
Experiment use at the end of your query the clause: GROUP BY u.id_usuario, i.thumb Would something like this: SELECT a.*, u.id_usuario, u.nome AS nome_usuario, i.thumb AS nome_imagem FROM anuncios a…
-
6
votes1
answer742
viewsQ: Improve the performance of a query
How could I improve this query, which returns me the top 10 sales to assemble a chart, so that it processes more quickly? set @startDate :='2015-01-03'; set @endDate :='2015-05-31'; set @dst_id:=1;…
-
4
votes2
answers501
viewsQ: import 1.2GB Mysql database
I’m having a hard time importing him into the process along the way. How long it takes on average to import a 1.2GB Mysql base into a linux-based Core 2 Duo?
mysqlasked Ivan Ferrer 12,096 -
0
votes1
answer634
viewsA: Can you read a json and get all the strings without knowing what’s inside?
Think of it that way: This is an object: { }, and that’s an array: [] Every "JSON" output is considered an object. Even the Javascript array is viewed with an object only of the Array type. In this…