Posts by Jeferson Assis • 2,719 points
97 posts
-
3
votes2
answers1317
viewsA: PHP - If there is no content on the line do not display
You can do it right on query SELECT * FROM techloja WHERE img IS NOT NULL ORDER BY RAND(), id DESC LIMIT 12 If you save the blank field instead of NULL SELECT * FROM techloja WHERE img != "" ORDER…
phpanswered Jeferson Assis 2,719 -
2
votes1
answer24
viewsA: Keep field data as select
Try it that way: <div id="alterar" style="text-align: center; "> <?php echo ($_SESSION['Ativo'] == false) ? '---' : $visualizarS->QtdPax; ?> </div>…
phpanswered Jeferson Assis 2,719 -
1
votes2
answers567
viewsA: Add a fixed line to every 50 PHP CSV lines
In the generation of your CSV, in the looping part you can make the calculation the rest of 50. Example: for($i = 0; $i< 100; $i++){ if($i%5 == 0){ echo '<hr />'; } echo $i.'<br />';…
-
7
votes2
answers1630
viewsA: What does the + sign in CSS mean?
According to the reference of W3C Assign the style to the next element after the previous one Example: div + p Select and style Every <p> element that are placed immediately after <div>…
-
1
votes3
answers98
viewsA: Show BD value in Dropdown Box
You can check in the looping you do to add the options if the ID is equal to ID of the logged-in user level $nivelUsuarioLogado = 2; $niveis = array( 1=>'Administrador', 2=>'Usuário Comum' );…
-
0
votes2
answers230
viewsA: Search with date range
Quote ' on the dates data_inicial >= '2015-10-14' and data_final <= '2015-10-14'
-
5
votes3
answers9183
viewsA: How to reset Mysql auto-increment?
Remember to delete all records from the table before using the command you tried. ALTER TABLE tabela AUTO_INCREMENT = 1 You can use the panel PHPMyAdmin, select the table and then the menu…
-
2
votes1
answer31
viewsA: Access global var
You can use the self if using the attribute in the same class self.myGlobal = "VALOR" Example: class ViewController: UIViewController { var myGlobal : String? override func viewDidLoad() {…
-
0
votes3
answers565
viewsA: Repeat LEFT JOIN with other parameters in the same query
You can use the SUM() with IF() SELECT pai.nome, SUM(if(filho.sexo = 'm', 1, 0)) as somahomem, SUM(if(filho.sexo = 'f', 1, 0)) as somamulher FROM pai LEFT JOIN filho ON (pai.id = filho.idpai) GROUP…
-
2
votes3
answers512
viewsA: Add new field and leave it empty
You can user the find on your cloned item and change the value of the items within it. $(this).parent().clone(true).find('select, input').val('')
jqueryanswered Jeferson Assis 2,719 -
0
votes2
answers1281
viewsA: Return JSON to PHP
Adds the header Content-Type header('Content-Type: application/json'); echo json_encode($endereco);
-
1
votes1
answer328
viewsA: Swift 2 - Variable with null value
I tested here with your code and the return is saved in the variable normally. You just need to change a few points. 1) Your json is a array and not a dicionary, change to: var values: Nsarray = []…
swiftanswered Jeferson Assis 2,719 -
2
votes1
answer505
viewsA: Format Array differently
In his foreach adds the key $key and change the names of the fields <?php foreach($lista_funcionario as $key => $valor){ /* Verificando se o tipo de parametro é vale */…
-
1
votes1
answer31
viewsA: Add '%' and format value in text field
The function does not lock only number in that field $('#base_calculo').on('blur', function(){ var valor = $(this).val(); valor = valor.replace(',','.'); if(!$.isNumeric(valor)) return; valor +=…
jqueryanswered Jeferson Assis 2,719 -
3
votes2
answers3190
viewsA: how to make an event using the enter key?
You can use this code $(function(){ $('input, textarea').on('keypress', function(e){ if (e.keyCode == 13) { e.preventDefault(); $("#BotaoId").click(); } }); }); If you understand English you have an…
-
2
votes1
answer54
viewsA: how to make Ceil call
The mysqli_fetch_assoc returns a array of results. PHP documentation (PHP 5) mysqli_result::fetch_assoc -- mysqli_fetch_assoc - Get a line from result set as an associative matrix The error you are…
phpanswered Jeferson Assis 2,719 -
0
votes1
answer59
viewsA: Recovering value combobox javascript
Using Javascript only: HTML <select id="area" name="area"> <option value="">Selecione</option> <option value="Informática">Informática</option> <option…
-
2
votes3
answers3563
viewsA: mysqli_escape_string() expects Exactly 2 Parameters, 1 Given
The error happens because the function mysqli_real_escape_string expects to receive 2 parameters in procedural mode. string mysqli_real_escape_string ( mysqli $link , string $escapestr ) And only 1…
-
2
votes3
answers373
viewsA: Reset button on the form
You can use a function in javascript to clear the fields $(function(){ $('#aceitar').on('click', function(){ $('#enviar').prop('disabled', !$(this).is(':checked')); }); $('#limpar').on('click',…
cakephpanswered Jeferson Assis 2,719 -
4
votes1
answer60
viewsA: Bootstrap creating a new column for the second title of the same month?
The problem is in the logic of your foreach and not in Bootstrap Change the foreach by this which will work: foreach ($eventos as $evento) { $mesAtual = $evento->data->format('F'); if…
-
2
votes1
answer72
viewsA: Interrupt a chain of actions on SWIFT
How you used your own storyboard to make connections between the screens, you need to treat the rule on shouldPerformSegueWithIdentifier SWIFT2 override func…
-
2
votes1
answer866
viewsA: Pause or Terminate Youtube Video
Use your own Javascript API Youtube Start the video and put it in the player variable (as the example of the API itself) var player; function onYouTubeIframeAPIReady() { player = new…
jqueryanswered Jeferson Assis 2,719 -
1
votes2
answers104
viewsA: time() Function php
Instead of using the date() you can use DateTime which has several interesting methods. Doc PHP - Datetime Using the method add() - Doc Datetime - Add Example: $now = new DateTime(); echo…
-
5
votes3
answers9315
viewsA: Ask if the user really wants to leave the page?
Use the window.onbeforeunload Html: <textarea id="comentario"></textarea> <a href="">Sair da página</a> Javascript: window.onbeforeunload = confirmExit; function…
javascriptanswered Jeferson Assis 2,719 -
1
votes1
answer94
viewsA: problems with infinite loop using PDO::FETCH_ASSOC
The foreach runs through all the elements array of data that returns to the end and for when you have no more data. Already the while will always be doing the checking and the way you did it will…
-
0
votes1
answer569
viewsA: Why is "overflow:Hidden" not working on my slide?
You didn’t put the div with class slideshow in your code. I created an example with your code but adding this div Example link EDIT: In the example I put the max-width only with 300px for testing.…
cssanswered Jeferson Assis 2,719 -
2
votes1
answer268
viewsA: How to remove 'Invalid username or password, Try Again' message from Cakephp login page?
You can check if the page request is a post with the $this->request->is('post'); public function login() { if($this->request->is('post')){ if ($this->Auth->login()) {…
-
1
votes2
answers31
viewsA: Help Sintx error
The error is in $_POST, cannot start class attribute values this way. The idea is to create a constructor by receiving the parameter. class Pessoa{ var $codigo; var $nome; var $altura; var $idade;…
phpanswered Jeferson Assis 2,719 -
4
votes4
answers4026
viewsA: Percentage Com javascript
You can check by dividing by 4 or multiplying by 0.25 var valor_input = 25; var valorAtual = 50; //Dividindo por 4 if( valor_input > (valorAtual/4) ){ //Aqui você poem o aviso ou um alert…
javascriptanswered Jeferson Assis 2,719 -
1
votes1
answer59
viewsA: What is the best way and how to implement global data storage in an application?
You can use the SharedPreferences For more information visit android documentation Edit: If you understand English you can use this Stackoverflow English reference In free translation: To get…
androidanswered Jeferson Assis 2,719 -
9
votes2
answers104
viewsA: How to resolve duplicate PHP object?
When you use $objet2 = $obj1 = new Objeto();, the two variables are pointing to the same object. You can give a echo in the attribute Nome of each object and see that will always return "Mark".…
-
1
votes1
answer2313
viewsA: How to find Fatal error: Out of memory wp-db.php
This error is not specific to Wordpress but to PHP, it is breaking the memory limit. You can increase the memory limit: By code ini_set('memory_limit','QTDE_MEMORIA'); By php.ini memory_limit =…
-
2
votes2
answers8705
viewsA: Compare items from different tables
You can use it INNER JOIN by the column Nome SELECT Pessoa1.Nome FROM Pessoa1 INNER JOIN Pessoa2 ON (Pessoa1.Nome = Pessoa2.Nome) EDIT: Not ideal to use INNER JOIN without an indexed column, it can…
-
3
votes3
answers488
viewsQ: Keep data from a list when rotating on Android
I started to study Android and I ended up falling into this problem. I created a RecyclerView where it is fed by a field TextView, but every time I rotate the simulator, the values are reset. I…
androidasked Jeferson Assis 2,719 -
5
votes1
answer46
viewsA: How do I get my code to show the highest of each species?
Using the ORDER BY, crescent ASC or decreasing DESC. SELECT * FROM friends_of_pickles GROUP BY species ORDER BY nome_da_coluna (ASC|DESC); EDIT1: Reference W3C:…
sqlanswered Jeferson Assis 2,719 -
1
votes3
answers13847
viewsA: Pick up value from a radio button
You can use this solution that is in Stackoverflow english. var choices = []; var els = document.getElementsByName('choice_shrd_with_me'); for (var i=0;i<els.length;i++){ if ( els[i].checked ) {…
javascriptanswered Jeferson Assis 2,719 -
1
votes2
answers121
viewsA: Add or Show amount of items
You can get the result straight with the mysql_fetch_assoc() or mysql_fetch_array(). $command_ = "SELECT COUNT(`usr_id`) FROM `app_users`"; $result = mysql_fetch_assoc(mysql_query($command_)); The…
-
2
votes2
answers834
viewsA: jQuery fetch all checked checkboxes from a div through a click on button
You can change your button code and javascript by these: Knob (change this in for id on link tag <a> and remove from image) <a href="" id="copiarParaTodasAcoes"> <img…
-
2
votes1
answer105
viewsA: Percentage of Completion
You can do this with jquery, I created a basic example. Javascript: $(function(){ var total = $('input[type=checkbox]').length; $('input[type=checkbox]').on('change', function(){ var selecionados =…
-
1
votes1
answer542
viewsA: uitextfield check with only number
You can use the Uitextfield delegate Implementation in Objective-c: -(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string Within…
-
1
votes3
answers2496
viewsA: Problem with special characters
I didn’t get to use Laravel, but most frameworks have a charset setting (remember also that your bank is recommended to be on the same charset). This link maybe I can solve your problem…
-
3
votes4
answers4241
viewsA: How to get the amount of records in a query in Sqlite?
You can do a query to get the amount of records before making the main query. SELECT COUNT(*) FROM Cadastro After receiving the result, you can use your logic to check whether the returned quantity…
-
1
votes1
answer163
viewsA: jquery element change with time interval
I’m not sure I understand your problem, but I think this might help you: $(function(){ var interval; $('div').on('click', function(){ $('div').removeClass(); clearInterval(interval); interval =…
-
1
votes1
answer257
viewsA: Capture youtube play click event
You can use the Youtube Javascript API (https://developers.google.com/youtube/js_api_reference?hl=pt-br) Using the callback onStateChange, you get what kind of video status. Events onStateChange…
-
0
votes1
answer40
viewsA: Trade banner as http_referer and limit clicks on this banner
You can use http_referer for the $_SERVER global variable - $_SERVER['HTTP_REFERER'] http://php.net/manual/en/reserved.variables.server.php With this you can use cookies to make all your logic to…
phpanswered Jeferson Assis 2,719 -
0
votes1
answer716
viewsA: Apache does not read subfolders or other files
Probably the mod_rewrite not active in your apache, check if this active.
-
1
votes3
answers2591
viewsA: How to create a mobile desktop shortcut for a Web App?
You can use the following tags <link rel="apple-touch-icon" sizes="57x57" href="http://arpadesign.com.br/img/logo_touch_57x57.png"/> <link rel="apple-touch-icon" sizes="72x72"…