Posts by Ivan Ferrer • 12,096 points
772 posts
-
1
votes3
answers1954
viewsA: Problems adding item to array with Angularjs
The estate push only works for arrays, for objects it does not assign values. In this case, assume that your collection is an object with two indexes 14 and 15 and within one of these indices there…
-
0
votes4
answers80
viewsA: How to print next line
From what I understand you want to list everything putting the first record in one format and the second in another, for this is very simple, just check the rest of the division: <?php $result =…
-
11
votes1
answer1603
viewsA: How to bring table with data when returning from an Insert
Try something like this, on date, try to parse: var saida = jQuery.parseJSON(data); It takes the output of the status, and makes a query in the database bringing the data in an array, in this array…
-
0
votes3
answers366
viewsA: Get URL paths
There is a n ways, the best I consider for sure is to virtualize your website host (vhost) and create a constant for in each virtualized environment, keeping the output of constant by default for…
-
0
votes3
answers2944
viewsA: What is the best way to enter a large amount of records into the database?
Like a shipment system, we usually import everything and then compare the data. One suggestion I can give you is, create a temporary table in the database just to import all the data at once,…
-
1
votes1
answer131
viewsA: How to Insert with values posted in textarea
The way you are doing this is not one of the best, nor the most correct way to do it, the ideal would be to create input fields="text", and with one button replicate and another to remove, with a…
-
3
votes1
answer395
viewsA: How to avoid collision of upload file names
You can solve your problem in a very simple way, just add a numerical sequence if the file already exists: if (empty($_FILES)) { echo "<center><h1>Please, select the…
-
0
votes3
answers6543
viewsA: How to mask the URL after hiding a GET with history.pushState?
Do something like this [a pity that replaceState does not work in IE 7,8 and 9]: function recoverUrlNotParams() { var params = window.location.search; var url = window.location.pathname; if…
-
0
votes1
answer137
viewsA: Google Chart pass ID of a bank column
Use Wrapper to insert all Googlechart packages, so you don’t have to pass dependencies on load: google.visualization.events.addListener(chart, 'select', function () { //dentro do seu método de…
-
0
votes1
answer2080
viewsA: Change the background-image of the div according to the banner image
In your HTML you put like this: <div class="banner-backg"> <div class="banner-center"> <ul class="bxslider"> <li><img src="images/banner_1.png" /></li>…
-
0
votes1
answer24
viewsA: Sort articles via link
I believe you can do this, posts_per_page (n = number of records), and offset (n = how many records you will skip): ?orderby=title&order=asc&posts_per_page=n&offset=n…
-
2
votes1
answer109
viewsA: How to put a string at the end of all Urls via PHP (Codeigniter)
To disable Codeigniter cache you can remove this tag from your project or reset the cache time: $this->output->cache(0);
-
0
votes3
answers371
viewsA: error while creating table with Foreign key mysql
Whenever you create a referenced table for a database "with data", by default, Mysql, does a check of the referenced indexes, when it does not find the reference within the table usually gives this…
-
0
votes2
answers477
viewsA: List every month in Query or PHP?
You can put inside the date list this way: $dataList = array(); $aDados = $rep->SelDados($dtIni, $dtFim); $nCount = count($aDados); function getInterval($nCount) { $m = 1; for ($i=12; <=132;…
-
1
votes1
answer138
viewsA: make a button disappear
Change your code for this: <script type="text/javascript"> function setClassTable() { $("td:nth-child(1),th:nth-child(1)") .addClass('hidden-md hidden-sm hidden-xs'); for (var i=4; i<=7;…
-
1
votes1
answer408
viewsA: ASP with SQL bringing different result of the query
I’m getting used to PHP language, but I’ve already touched classic ASP, its I remember, it was something like this: <p class="textoPainel"> <% if not BUSCA3.eof and not BUSCA3.bof then…
-
1
votes1
answer4184
viewsA: Load content into a DIV using Javascript
There are better ways to do this, take a look here: https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_HTML5_audio_and_video. There’s also this API that can help you with video insertion:…
-
-1
votes1
answer81
viewsA: Updating hierarchical data using hierarchyId
I think you want something like that, I’m sure? SET SQL_SAFE_UPDATES=0; UPDATE Atividades mae LEFT JOIN Atividades filho on (mae.id_mae = filho.id) SET mae.valor = mae.valor + 31, filho.valor = 31…
-
2
votes2
answers606
viewsA: Sort result using CASE and BETWEEN
You are making the use of CASE in the wrong way, the correct one would be something like this: CASE condicao WHEN valor1 THEN 'valor1' WHEN valor2 THEN 'valor2' ELSE 'valor_alternativo' END And even…
-
1
votes1
answer339
viewsA: Create search tags for Select2
To do this, you have to hide the options, disable them with disabled and then give a Trigger in the elements when selecting them as I did in this example: http://jsfiddle.net/jEADR/1842/ In CSS you…
-
1
votes1
answer339
viewsA: How not to select records that are within a date?
How could you get around the problem: Create an auxiliary table with the rental dates of the apartment called leasing dates. Then instead of putting the dates in a single field, refer to the given…
-
1
votes1
answer89
viewsA: Mysql - Returning some records only if grouped
What may be occurring may be both problems in your mysql, or computer schema problem, or a corrupted data problem in your database. You can try to repair all the tables in your bank using the…
mysqlanswered Ivan Ferrer 12,096 -
11
votes2
answers694
viewsA: How to create a drawing in open book format and with content inside?
Open the image in Photoshop by selecting the text area, with the selection tool, click with the dropper in the white area of the paper where the text is, with the selected color paint it white with…
-
4
votes2
answers1428
viewsA: Send objects to a base.html Django template
You can do it this way in your view: {% extends variavel %} And in the project something like this: import django.http from django.shortcuts import render_to_response # declarando uma constante aqui…
-
2
votes2
answers658
viewsA: how to display related posts via php tags
first case: You can do something like this: SELECT *.noticias, noticias.tags FROM noticias WHERE noticias.tags IN('mysql', 'php', 'jquery') ORDER BY data_noticias DESC, noticias.tags; Of course:…
-
1
votes1
answer346
viewsA: Accent problems with PHP and Mysql
Try this and see if it solves the problem: ALTER DATABASE `sua_base` CHARSET = UTF8 COLLATE = utf8_general_ci;
-
2
votes3
answers485
viewsA: Make an ORDER in Mysql from another TABLE
SELECT chat.*, users.* FROM chat INNER JOIN users ON(users.id=chat.id_de) WHERE chat.id_de = '$id_pessoa' ORDER BY chat.data DESC …
-
0
votes2
answers471
viewsA: Extract certain data from a Json array
Thus: <tr> <td ng-repeat="x.opcionais as dado"> {{dado.opcional_id}} {{dado.opcional_nome}} </td> </tr>
-
0
votes3
answers141
viewsA: Query problem - Accentuation
If it is turning your input into the database query, then there is a charset problem yes. One way to force your data entry into your query is by using: html_entity_decode($data), or do better, open…
-
1
votes2
answers16294
viewsA: Increase timeout of a page
Do so: $segundos = 0; set_time_limit($segundos);
phpanswered Ivan Ferrer 12,096 -
2
votes2
answers96
viewsA: Buttons made with images
First you create an image with two transitions according to the example below: _______________ |+++++++++++++++| |++++ligado+++++| |_______________| |---------------| |---desligado---|…
-
2
votes4
answers3696
viewsA: Multiple Bootstrap Alerts
Surely there’s... there’s n possible ways, but based on your example, you can simply do so: function setTextInAlert(classe, message) { $('.alert').attr('class', classe);…
-
2
votes1
answer3098
viewsA: How to check the constraints in the bank
Try this to see all constraints: select * from information_schema.referential_constraints where constraint_schema = 'NOME_DO_SEU_BANCO' For SQL Server, you have more information here:…
-
2
votes3
answers1771
viewsA: How to confirm that the page has left?
To confirm you can use the javascript "confirm" function <?php session_start(); if ($_POST['action'] == 'logout') { unset($_SESSION['nome']); unset($_SESSION['senha']); /* aqui você coloca o…
-
1
votes6
answers17792
viewsA: Accentuation problem while recovering records in SQL Server
You can use the PHP function:html_entity_decode($valor);
-
1
votes2
answers2256
viewsA: Break line after semicolon ;
I have this complete method that does all the work to separate the email data: function setEmail($stringMail) { $nstringMail = preg_replace('/\;/',',', $stringMail); $nstringMail =…
-
0
votes6
answers3667
viewsA: Are there objective advantages to a language being "case sensitive" or not?
Besides perfumery, of course (there is an attempt to standardize the code, which should, does not happen very often)... There are some significant advantages, for example in encodings such as…
-
0
votes3
answers743
viewsA: Confirmation for deletion
Putting the data in two fields Hidden I believe it works: <input type="hidden" name="cod_cli" value="<?php echo $_GET['P_COD_IDENT_CLIEN']; ?>"> <input type="hidden" name="tipo_cli"…
-
4
votes2
answers509
viewsA: Format Mysql Now() function return
Try formatting the output value, example: SELECT DATE_FORMAT(NOW(), '%H:%i:%s');
-
0
votes2
answers395
viewsA: How to extract only 1 image from Json?
To get the first image is as simple as that: var img = $scope.nomes.imagens[0]; console.log(img); Example: http://www.jsoneditoronline.org/? id=b3d9a7b5bd1765a942eede975554c67c…
-
1
votes2
answers1263
viewsA: How to search by class (instead of id) in Javascript/jQuery
You can do this using jquery: $(document).ready(function() { var elementoDaClasse = $(".nomeDaSuaClasse"); }); or use javascript without dependency in this way: var elementoDaClasse =…
-
0
votes2
answers287
viewsA: Lightbox does not cover the entire screen
Change your first line to: .mtlsr-lightbox { display: none; position: absolute; width: 100%; min-height: 100%; height: auto; z-index: 999999; top: 0; } And take the test. But first set your body to…
-
2
votes1
answer472
viewsA: character error when decoding a variable from js to php
The problem is that you are decoding the javascript function and not the Document.write output, because php sends the information to the server first, then runs the javascript. I kept the output in…
-
0
votes1
answer44
viewsA: Get Websql values when loading the page through Javascript
Try doing it this way: function getChamadasFromDay() { db.transaction (function (tx) { var total_time = 0; var total_chamadas = 0; tx.executeSql ('SELECT * FROM chamadas WHERE d_day=? AND d_month=?…
-
0
votes2
answers1463
viewsA: Receive php Json values in Javascript for Chart.js charts
I didn’t quite understand what the problem is nor the need to use a "each" for an associative array already with the number of predefined elements, but if it is the case to bring a collection of…
-
0
votes3
answers210
viewsA: What’s the difference between var $var and public $var?
The variable declared as var $var2; is being discontinued since the php4 version. From php5, it was possible to modify the access of class attributes and methods to enable a more performatic range…
-
0
votes4
answers646
viewsA: Perform function by clicking except on specific item with jQuery
Maybe that’s what you want: $(".teste, .link").on('click', function() { if ($(this).attr('class')=='link') { return true; } return false; });
-
0
votes1
answer71
viewsA: One Function interferes with another
From what I understand you want something like this: function anterior(acao) { var data = 'inicio'; if (!executora(acao)) { for (var i=0; i<=20; i++) { if (i==0) { data=''; } data += 'executou…
-
1
votes4
answers306
viewsA: How to link to table?
I believe this solves in the case of three: echo '<tr style="cursor:pointer" onclick="location.href=\''.$link.'\'">';
-
0
votes2
answers8910
viewsA: Populating selects of cities and states with AJAX (PHP and jQuery Mobile)
For jQuery ajax to be loaded every time, you can use Jquery delegate method, example: $(function() { $(document).delegate('#estados', 'change', function() { var valor = $('#estados').val();…