Posts by KaduAmaral • 11,472 points
313 posts
-
2
votes2
answers436
viewsA: PHP instruction executed directly by Mysql
From what I’ve seen, it’s possible, but it’s not simple... You need to import the udf library in the MYSQL to use a function called sys_exec. Then you could create a Trigger so that whenever there…
-
0
votes3
answers208
viewsA: Writing to Mysql with PHP
Your database modeling is wrong, cannot save equal records at the bank, they need to have unique identifiers, usually the field ID as AUTO_INCREMENT, so you don’t need to inform it in the INSERT SQL…
-
0
votes2
answers184
viewsA: Optional shopping cart
I don’t really know how your project is going, nor the reason for using checkbox among other models, I also do not know if it is easy to change or not. But I took the liberty of making a code that I…
-
4
votes1
answer1593
viewsA: Foreach repeating the same content
You can use form fields as if you were a Array and access them with PHP. <td><input type="text" name="track[]"></td> <td><input type="text" name="artist[]"></td>…
-
2
votes2
answers151
viewsA: Blog pagination, post limitation
Note the structure well. In your code, you cannot use a variable before you have declared: ///Ler posts do blog da página atual $result = mysql_query("$busca LIMIT $inicio,$total_reg"); Like you did…
-
3
votes2
answers1061
viewsA: How to send data from a php filter with multiple search fields
The best is to use POST for this type of action, especially if you have some field of the type textarea, where the content can be very large and can extrapolate the url limit (despite not having an…
-
2
votes4
answers817
viewsA: SQL Condition Array - PHP
Consider using a library for database management. ;) Connectionmsi Then you could do something like: $keys = array('nome', 'sexo', 'estado', 'cidade', 'fone'); $where = Array(); foreach ($keys as…
-
2
votes4
answers6839
viewsA: Block pages using login and Session
In the file that checks user information, store the user ID in a session. <?php session_start(); // Inicia a sessão // Pega os dados do usuário $stmt = $con->prepare("SELECT usuarioId FROM…
-
5
votes2
answers27161
viewsA: How to destroy a specific session?
You can do it like this: session_start(); $tmpemail = $_SESSION['email']; $tmpsenha = $_SESSION['senha']; session_destroy(); session_start(); $_SESSION['email'] = $tmpemail; $_SESSION['senha'] =…
-
1
votes1
answer197
viewsA: How to make the movement of a paragraph not influence other elements
I didn’t quite understand the purpose, but to do it without much whining, you could use the image as background. http://jsfiddle.net/tpz1gka3/14/…
-
2
votes2
answers547
viewsA: Foreach - check and record only those not in the BD
Do it like this: // Recebendo o array com os ID´S $checkboxes = $_POST['check']; $IdTreinamento = $_POST['IdTreinamento']; // Verificando os Colaboradores existente…
-
6
votes1
answer271
viewsQ: Integration with GIT
I wonder if Git provides an integration API, like I’m developing a C# application and would like to know if there’s any way to get the files from the latter Commit. I took a look at the GIT website,…
-
0
votes1
answer107
viewsQ: Route Translation with Cakephp
I’m studying Cakephp for possible use in a project, and the crux of this project is that it’s multi-language. Only I’ve done a lot of research on route translation: http://projeto.com/contact…