Posts by Rafael Salomão • 2,027 points
94 posts
-
3
votes1
answer275
viewsA: How to make encrypted password queries in the database?
Your sweetheart seems to have a syntax error. It’s like this : "select * from usuarios where email='{$email}, senha='{$hash}'"; The right thing would be : "select * from usuarios where…
-
0
votes1
answer770
viewsA: Access database via Mysql Workbench
To give the user permission to access you can run this querie: GRANT ALL PRIVILEGES ON db_name.* TO'username'@'seu_ip' IDENTIFIED BY 'password' INTERCHANGE: db_name by the name of your database.…
-
1
votes3
answers1626
viewsA: Single ID generation with Mysql
Could do that : $aleatorio = rand(6,6); // 6 CARACTERES $valor = substr(str_shuffle("AaBbCcDdEeFfGgHhIiJjKkLlMmNnPpQqRrSsTtUuVvYyXxWwZz0123456789"), 0, $aleatorio); Then check if the value already…
-
1
votes1
answer126
viewsA: Include data via a Mysql/PHP explode
There’s one more detail Notice you just set it up like this : <select name='Materias[]' id='materias' class='form-control'> i asked to rename, to also have the understanding of the day there…
phpanswered Rafael Salomão 2,027 -
2
votes1
answer199
viewsA: How to create a custom log in php
This class was built in 2011 or 2012, therefore it would not use in another project only serves as understanding to treat errors: <?php header('Content-Type: text/html; charset=iso-8859-1');…
phpanswered Rafael Salomão 2,027 -
0
votes1
answer26
viewsA: Duplicated meta title and meta Description because of category filters
Use in your html to meta cannonical : <link rel=”canonical” href=”URL” /> This will indicate the serps which main content url then redirect 301 of the wrong url to the correct one. Wait a few…
-
1
votes2
answers324
viewsA: Insert ID into Table with 13,346 lines with LOOP
To add a new attribute to your table and set it as auto-increment you can run a ALTER TABLE thus : ALTER TABLE `nome_tabela` ADD COLUMN `faixa_cep_id` INT(10) NOT NULL AUTO_INCREMENT FIRST; Example…
-
1
votes1
answer252
viewsA: INNER JOIN and FOREACH
The relationship between your tables product and bottom is of 1:N. A product can contain many colors. At least that’s what I understood from your image. However, despite having constructed a…
phpanswered Rafael Salomão 2,027 -
1
votes1
answer101
viewsA: Redirect through htaccess
Could do so : RewriteRule ^index\.php/(.*)$ /$1 [L,R=301] Redirect the url that contains after the domain index php. escaping the point with backslash, preceded by / (bar), and a set of characters…
-
0
votes1
answer879
viewsA: Create new instance in Mysql
You could use the mysql_multi to run two database instances on the same server. You should note that to have a great advantage over this configuration, the ideal is to use each database about hard…
mysqlanswered Rafael Salomão 2,027 -
0
votes3
answers346
viewsA: Redirect file access via htacess
Brother, you could try this : RewriteRule ^([a-zA-Z0-9_\-]+)\.txt$ download.php?arquivo=$1 Anything started contains letters from a to z in lowercase and from A to Z in uppercase, underline or dash…
-
0
votes1
answer247
viewsA: How to perform form search using ajax?
You set your ajax (post) within the Submit event of your form. Ajax requests do not submit the form the submission is made internally by a browser native object. So it would be right to define a…
-
1
votes1
answer3522
viewsA: The wordpress code is modified, but the blog does not update. What will it be?
Usually when you build a website you create a system of cache for its pages to prevent every visitor who enters the site from having to consult the database and perform all routines necessary to…
-
2
votes1
answer554
viewsA: Query returning duplicate values
I believe I can do that: SELECT TABNOV.CODIGO_ANDAMENTO, TABNOV.NUMERO_PROCESSO, TABNOV.DESCRICAO_ANDAMENTO, TABNOV.DATA, TABNOV.DATA_INCLUSAO, TABNOV.HORA, TABNOV.EMAIL_ENVIADO,…
-
7
votes1
answer343
viewsA: What does this htaccess regex do?
This is a rewrite rule that is saying that the URL started with www/login preceded by / (bar) or not, redirect to login/. As flags [L,NC,R] means: The [L] is last, that is, in a list of conditions,…
-
0
votes2
answers1723
viewsA: How to remove index through . htaccess file from site?
The correct way to do this is by passing all the relevance of the index to your target page (Uritiba), if you just do a raw redirect, you will lose all relevance in the Serps (google, Bing, yahoo,…
-
2
votes2
answers1036
viewsA: UPDATE in two PHP tables
You could do an INNER JOIN (join tables) effecting a relationship between the entities by the primary key of the registration table with the foreign key of the individual table and effecting the…
-
1
votes1
answer856
viewsA: Block PHP page access through the URL | Doubt about PHP page security
If this session is established through login and password yes access is secure however in your code where you do the redirect could send together with the redirect a response header HTTP status…
-
0
votes2
answers7693
viewsA: Foreach in SQL to put a value in a variable
You must set a cursor if you need to loop through your querie’s records. To do this set a cursor with your query and the variables where the table attributes will be stored at each new increment of…
-
0
votes2
answers59
viewsA: How to get elements from a different page?
I don’t know if this would help, but you could request an external url with jquery $.get( "url", Function( date ) { $( ".result" ).html( date ); Alert( "Load was performed." ); }); Get method Then…
javascriptanswered Rafael Salomão 2,027 -
1
votes1
answer331
viewsA: Split into URL AMIGAVEL without creating folder
You need to specify rules in your htaccess this way: Rewriterule contato? index.php? area=contact [L] And in your index file perform a routine to load the data by area. Explaining the above rule: I…
-
3
votes3
answers873
viewsA: Do not return a field value when it is zero
Yes this is possible through the IF command Thus : SELECT IF(MEDIA_SALARIO = 0 , '', MEDIA_SALARIO) FROM FUNCIONARIO WHERE ID_FUNCIONARIO = 1; You can also customize values when they are null like…
-
2
votes1
answer307
viewsA: PHP Slow - Code or Hosting?
The issue is confusing but if you are trying to catch strains of two different months to compare which strain you have lost in the current month. You should assemble a querie with just a select…
-
0
votes1
answer128
viewsA: Recover city from database id
There is an error in your insertion: Note this example the syntax should contain the name of the fields you will insert, mysqli_query($con,"INSERT INTO pessoa ($FirstName,$LastName,$Age) VALUES…
-
1
votes2
answers50
viewsA: <audio> in hidden div
You can get the Dsplay value from your div with the code below then use an if to determine the action on the audio. var display = $('.fig1').css('display'); var som =$(soundobj); if(display ==…
jqueryanswered Rafael Salomão 2,027 -
1
votes1
answer754
viewsA: set_time_limit() error has been disabled for security reasons in
Your php.ini settings on your server do not allow you to change the set_time_limit at runtime (direct within the script); set_time_limit(0); You should change this in the php.ini file settings on…
phpanswered Rafael Salomão 2,027 -
0
votes1
answer217
viewsA: Redirect DDNS to Tomcat
Note that Domain is pointed to an offline ip. Check if the ip of your server is the same if it is not go to the program you installed and fix the ip. It may also be possible that Winco has not yet…
-
1
votes1
answer1903
viewsA: Free up memory in php
Daniel does not need to worry about the memory release of php he manages it. In reality when a theards of apache Nginx or lighttpd runs it runs php as a child that runs its php routines at the end…
phpanswered Rafael Salomão 2,027 -
0
votes3
answers118
viewsA: Logic for using foreign key - a user’s notes
If a product has N questions then in modeling it is assumed that we have to have 2 tables one for products and other for questions because this is a relation called 1:N or I mean: A product can have…
-
1
votes1
answer229
viewsA: Check the number of copies that have been printed
Private Sub Workbook_BeforePrint(Cancel As Boolean) If ActiveSheet.CodeName = "Sheet1" Then With Sheet1.Range("A1") Select Case .Value Case Is > 0 .Range("A1").Value = .Range("A1") + 1 Case Else…
-
1
votes1
answer249
viewsA: AJAX return JSON size
I do not believe that you have not received the whole package once a reply request leaves the backend server, ajax only returns 200 status when all the header and content is returned to the browser.…
-
0
votes1
answer49
viewsA: Insertion problems in two Mysql PHP tables
I believe the error is here : if($inserts) about Insert mysql_query does not return true to achieve this must use the command mysql_affected_rows to analyze how many lines were affected. mysql_query…
-
1
votes1
answer70
viewsA: Load extra data by the id received by the array
So if you want to redeem the values of the product that was sent by post before performing this Index you have to select before in your database by product id; $dbi = Conexao::singleton(); $query =…
phpanswered Rafael Salomão 2,027 -
0
votes2
answers220
viewsA: php global variables
Daniel if these values are system constants create a file and within it define constants like this: define(NOME_CONSTANTE1,'value'); define(NOME_CONSTANTE2,'value'); then make a include on the pages…
-
1
votes2
answers274
viewsA: file_get_contets redirect user to url Random
The simplest and most elegant way to do : is to read this html with Doom: <li class="ohyeah"> <a href="http://www.site.com.br/nome/maria"> maria </a> <a…
phpanswered Rafael Salomão 2,027 -
2
votes1
answer189
viewsA: Create another class or not? PHP/POO
Opa Eduardo, because it does not create an abstraction of data or is an abstract class and uses an inheritance in the two classes so all common methods are in the abstract class with access by…
-
0
votes1
answer36
viewsA: MYSQL (People would like an example of how to list the services used for a client any x that has a dog with any name y)
There goes the fingertip! I advise changing the structure of your table to improve performance and use this querie: SELECT * FROM CLIENTES C INNER JOIN ANIMAL A ON C.ID_CLIENTE = A.ID_CLIENTE INNER…
mysqlanswered Rafael Salomão 2,027 -
1
votes4
answers629
viewsA: How to make a Popup that only records information on the cookie or anything and displays only once on the website homepage
I do not advise cookies so it is better to use session as soon as the user enters you starts a session and creates a variable where it is stored that he read the message then whenever he returns the…
-
0
votes1
answer100
viewsA: Transfer to "dd/MM/yy" format
I’m terrible at this language but I think I could do it : <table> <tr> <th>Nome</th> <th>E-mail</th> <th>Endereço</th> <th>Data de…
-
0
votes1
answer104
viewsA: requesting all main node_modules files
root@sdv 7 [~/Node/node_modules/live_webcam]# npm install body-parser --save All installed modules are within node_modules so to call is as below: In your Node APP file : const bodyParser =…
-
1
votes1
answer441
viewsA: Abstraction of the PHP PDO Connection class
You can create a Connections class that would be your interface to the database in front of your CONN class, within which constructor to define what type of database you will use. After…
-
0
votes3
answers61
viewsA: How to save date in mysql table
You can use the NOW() command for this would look like this: insert into testar (data,nome) VALUES (NOW(),'pedro');
-
1
votes1
answer235
viewsA: Maximum number of rows of a Mysql import
Your question got a little confused but if I understand correctly, you are trying to import your old database to your new server through phpmyadmin and are receiving a timeout. You can increase the…
-
1
votes2
answers157
viewsA: How to delete data from database?
It seems that your query delete is incorrect. The correct syntax would be : "DELETE FROM Medicos WHERE nome= ' ".$cbnome." ' " without the * (asterisk) The * is used for query tags as a wildcard for…