Posts by Guerra • 8,533 points
116 posts
-
6
votes1
answer7523
viewsA: (Mysql) Insert or Update in the database
INSERT INTO table (id, name, age) VALUES(1, "A", 19) ON DUPLICATE KEY UPDATE name="A", age=19 Reference: https://stackoverflow.com/questions/4205181/insert-into-a-mysql-table-or-update-if-exists…
-
1
votes1
answer163
viewsQ: GIT with multiple remotes in one project
I have project A which is my main project. From this project was born project B, by "Fork". Wonderful, so I want to develop things in Project A and I want to replicate them for Project B. When I…
-
0
votes1
answer52
viewsA: Help with database schema
I imagine your payment table will have the order id and the amount paid, so you can already know the difference to be returned. However, you can include a column in your payment table for this type…
-
0
votes1
answer115
viewsA: module.Exports mount an array with the api data
There’s a package on Ode that’s just for this. https://www.npmjs.com/package/config You pass the context of the environment and it gives you the right config. I hope I’ve helped…
-
4
votes3
answers367
viewsA: MYSQL relationship between tables
This "alias" is usually created for tables and columns to make it easier to reference them again in the query. For example, instead of writing category every time, just write c. This is not…
-
0
votes1
answer122
viewsA: how to work with friendly url
To do this via . htaccess should look like this the rule: RewriteEngine on RewriteRule ^download/avast-free-antivirus$ ./download/programa?id=1&cat=113&dev=1 And so on, but I must warn you…
-
0
votes2
answers89
viewsA: Contact form does not send some data fields
Fields are sent by form based on the "name" attribute of the form. In this case name is missing in select and textarea.
-
3
votes1
answer63
viewsA: How to make an array index not required in a validation with Respect Validation Key?
From what I understood from documentation: The method key has 3 parameters, where the third is "mandatory". I imagine it would be so: ->key('celular',…
-
0
votes2
answers376
viewsA: Dynamic Css background URL
Only if your CSS is generated in the file (phtml) in the . css file it does not process PHP and cannot do this. It is possible to do it via javascript.
-
1
votes1
answer336
viewsA: Return Ajax with multiple result and creating lines
You’re setting up the wrong JSON. You are not returning a Json with multiple lines but several with a line. The right thing would be to ride it that way: while (OCIFetch($consulta2)){ $array[] =…
-
2
votes1
answer37
viewsA: Help with SELECT returns
Probably your problem is in Inner Join, Switch to Left Join and see if it’s coming from the other table. Ex: $user = $_SESSION["usuario"]["id"]; $sel = BD::conn()->prepare("SELECT lk.*, ep.* FROM…
-
7
votes3
answers6551
viewsA: How to check if a value is date
With this check is possible: $data = DateTime::createFromFormat('d/m/Y', $_POST['data']); if($data && $data->format('d/m/Y') === $_POST['data']){ echo 'é data'; }…
-
0
votes2
answers423
viewsA: Check if the record already exists, if it exists does not change the value (MYSQL)
I don’t know how to do with Constraint but I would do so: if($_REQUEST['salva_ed'] && $pass && $pass != ''){ $sqlu="update registration set username='$username', firstname='$fname',…
-
1
votes2
answers780
viewsA: Error Insert PHP OO Sql Server sqlsrv_query() expects Parameter 1 to be Resource, Boolean Given in
Probably Connect() is unable to connect and returns a false. Return of sqlsrv_connect: A connection resource. If a connection cannot be successfully opened, FALSE is returned. And detail: return…
-
2
votes1
answer77
viewsA: Escape from regex in php
if (preg_match(preg_quote("(/?<=peerreview_form_settings-)([a-z0-9]+)/"), $result['name'], $matches) == true) { print("Match"); } The indicator was missing / to indicate the beginning and end of…
-
1
votes1
answer342
viewsA: How to Update Stock Using a CSV File
You can pass the CSV-consuming method to a model, and create a cronjob within Magento to run this method as long as you need. Example: In your module config.xml file create a tag outside the global…
-
0
votes1
answer71
viewsA: Return mongodb Collections in json_encode PHP
Is it not because you are replacing one object with another? $result = Array(); foreach ($user as $doc) {$result[] = $doc;} return $result;
-
1
votes1
answer46
views -
2
votes2
answers60
viewsA: Create custom variables
The right one would be to use a multidimensional array. And it’s not a good thing to use mysqlli either see here I think it’s a nice solution like this: First replace mysqlli with PDO: <?php $ret…
-
1
votes2
answers87
views -
4
votes2
answers6499
viewsA: How to make it impossible to select other checkboxes when selecting a checkbox?
You could put a class to group these checkboxes that you want to work from there would look like this: $(function(){ $('input.checkgroup').click(function(){ if($(this).is(":checked")){…
-
1
votes3
answers1607
viewsA: How can I view data using JOIN?
First you must normalize your database: here So we can turn your table into 7 example: nivel / altura / peso / tipo / tamanho / meio / litragem Thus, you would have a table equal to this, only with…
-
1
votes2
answers393
viewsA: Routes with Angularjs and Node.js
It is right to use only Node, With express you will probably want to capture all the requests and send to your example index.html: app = express(); app.use(app.router); app.use(function(req, res) {…
-
2
votes1
answer648
viewsA: How to display a result using 2 selects
In case you are trying to call a PHP method which is "server side" with javascript which is "client side" in this case. The ideal is to make another file to handle your AJAX request for example:…
-
3
votes2
answers1896
viewsA: How to make a record count for each day between a date and another?
SELECT count(*), DAYOFYEAR(colunaData) as diaDoAno FROM tabela WHERE colunaData BETWEEN dia and dia GROUP BY diaDoAno
-
1
votes2
answers120
viewsA: Inner Join not returning database values
The Inner Join only returns if the data is in both tables. Try replacing your Inner Join with a left Join just to see what information is missing.
-
0
votes1
answer367
viewsA: Error 404 with Codeigniter
That your url is wrong, what would crudex be? I think your correct url would be: http://192.168.33.10/index.php/user_controller
-
3
votes2
answers70
views -
1
votes2
answers61
viewsA: Database overloads while deleting lines with relationships?
It will generate yes querys to delete and will generate extra work to lift all the places that should be deleted together. But this on delete approach that makes it drop the associated keys is still…
-
1
votes1
answer34
viewsA: Dynamic request between development and production environment
You should set a static dns or ip for your servers and set as the base path of your requests.
javascriptanswered Guerra 8,533 -
3
votes1
answer794
viewsA: Webservice of the post office for more than one product per freight
You can sum the height width length information and make the cubage. If you do not exceed the maximum limits of the mail it will calculate well. If it exceeds you must ship separately or use a…
-
0
votes2
answers43
views -
1
votes3
answers8946
viewsA: Search ZIP by PHP Street
From what I understand the search for street needs to pass city and state too. Would something like this: var rua = document.getElementById('rua').value=(""); var cidade =…
-
4
votes2
answers419
viewsA: Hibernate ORDER BY ASC|DESC does not work by passing parameter
It is not possible to use parameters for Order By in this case you should create an example "criteria": Criteria c = manager.createCriteria(Classe.class); c.createAlias("paramFiltro", "campo");…
-
3
votes2
answers1311
viewsA: How do list sorted by letter?
Do something like this: letras.filter(function(item){ var inputValue = document.getElementByid('id').value; var regex = new RegExp(inputValue); return item.match(regex); }); Take a look at the…
-
4
votes3
answers795
viewsA: How to do a query that only refers to the DIA of a date?
Select * from tabela where DAYOFMONTH(CURDATE())-5 = colunaDia;
-
2
votes1
answer152
viewsA: Read XML inside Textarea with Jquery
I imagine it stays that way: Source: https://api.jquery.com/jQuery.parseXML/ var xml = $('textAreaSelector').val(), xmlDoc = $.parseXML( xml ), $xml = $( xmlDoc ), $imagem = $xml.find( "imagem" );…
-
4
votes3
answers695
viewsA: How to generate code in the javascript div
document.getElementByClassName('Creditos').innerHtml('codigo html aqui'); I imagine you want if someone copies your source code and remove the credit it identifies and redirects to your page,…
-
2
votes1
answer307
viewsA: Preload a folder with images
Well come on, Hypothetical situation, You have a div, where you will put your images, Let’s imagine: <div class='preload'><img src='urlimagem'></div> In this case, when loading…
-
0
votes2
answers8227
viewsA: Mask Percentage and Money field using only number?
Ever tried to use: <input type="number" step="0.01" min="0" >
-
1
votes1
answer189
viewsA: Load from Database only when all is loaded
There are some ways around this, One of them is to use lazyload that will basically upload the images as needed. An interesting feature of lazyload that I think you can incorporate to solve your…
-
0
votes2
answers985
viewsA: How to make an INNER JOIN not repeat information
You should perform group by by the "immovel.id" field Ex: $sqlxml = " SELECT clientes.id, clientes.nome, clientes.status, clientes.cliente, clientes.tipo, clientes.disponibilidade, imoveis.id,…
-
5
votes2
answers1150
viewsA: How to make a tutorial first access to the site?
I believe the best tool is: http://bootstraptour.com/ follows the documentation, example: var tour = new Tour({ steps: [ { element: "#my-element", title: "Title of my step", content: "Content of my…
-
1
votes1
answer341
viewsA: INNER JOIN 3 tables with pivot table
SELECT * FROM sellers INNER JOIN store_sellers ON sellers.id = store_sellers.id_sellers INNER JOIN store ON store.id = store_sellers.id_store
-
0
votes2
answers832
viewsA: I can’t log into Magento 1.9.2
There are some factors that influence admin login, the most common is the path of the cookie in the database is incorrect. Verify: UPDATE core_config_data set value "www.seudominio.com.br" where…
-
0
votes2
answers142
viewsA: Access multidimensional arrays of a php input
Since you don’t know the value of the key, the ideal is to go through the array: foreach($_FILES['imagens'] as $img){ echo $img['tmp_name']; }
-
5
votes1
answer2760
viewsA: Transforms . min file into "normal" file
Use that http://unminify.com/ but there are several options just search "unminify" .
-
4
votes2
answers187
viewsA: How would a regular expression find an attribute html + attribute value?
I’m not very wild in regex rs, but I’ll try to help: (data-placeholder=")(\w+(\s+|\w+)\w+)"
-
2
votes1
answer179
viewsA: Error making POST containing "@" or "#" in PHP with Curl
I imagine the solution is to use or the curl_escape if you use php 5.5 or higher. Or the urlencode which is similar and is the same native treatment of the browser. It does not cost to test and see…
-
3
votes1
answer177
viewsA: Disabled field does not pass to $_POST
That way the treatment will work: $campos[':DAT_FINAL_VINCU'] = array_key_exist('f_DAT_FINAL_VINCU',$_POST) && $_POST['f_DAT_FINAL_VINCU'] !== null ?…