Posts by André Martins • 1,481 points
98 posts
-
1
votes2
answers5894
viewsA: Fastest way to count how many records I have in a MYSQL table
You can use the Count() function to do this. SELECT COUNT(*) FROM tabela and you can also do this using filters from your tables to bring only what interests you: SELECT coluna1, coluna2, COUNT(*)…
mysqlanswered André Martins 1,481 -
1
votes2
answers1445
viewsA: How to insert $_POST in HTML form input?
Hello no need to even write php for this, just put the fields require="" that it is an attribute of HTML 5 so if there is no data inserted or will pass clear depending on the browser version:…
-
1
votes1
answer139
viewsQ: Bootstrap 2 does not float image
I’m having a problem trying to put one image next to another with Bootstrap: <ul class="thumbnails"> <li class="span4"> <div class="thumbnail"> <a href="#" class="thumbnail…
-
2
votes1
answer131
viewsQ: Problem with select dynamical to show dropdown menu for user
I am building the visualization layer for clients of a system in my database have two tables with relationships: and I have a method to return the results of these tables: public function…
-
1
votes1
answer342
viewsA: Unlink for multiple files
solved as follows: I first opened the terminal and edited the directory permissions: chmod 777 then I removed the echo from the method. public function deleteImagem($id) { $selectDasImagens =…
-
0
votes1
answer342
viewsQ: Unlink for multiple files
I am trying to use unlink to delete from a directory several images do not know what is happening apparently the logic is correct, my method is as follows: public function deleteImagem($id) {…
-
0
votes2
answers1093
viewsA: Delete data from cascading table
I was able to develop a method to be able to load the data for deletion, I did it as follows: public function tableCategoria() { $consulta = PDOUtil::getStance()->prepare("SELECT…
-
5
votes2
answers1093
viewsQ: Delete data from cascading table
I have some relationships on my tables and I’m willing to delete inversely. on my system the user will have the option to delete a category, here comes my question as I will do this because it…
-
1
votes2
answers449
viewsQ: MASK field does not render formatting
I’m trying to render a field input phone but not occurring as expected: <?php include_once '../entity/UsuarioEntity.php'; include_once '../configs/PDOUtil.php'; include_once '../dao/PaisDao.php';…
jqueryasked André Martins 1,481 -
1
votes2
answers2411
viewsA: Uncompressed data with Internet JOIN using PDO
As @rray demonstrated what it needed would be the aliases nicknamed for some columns of some tables that are equal so the method looked like this: public function tableUsuario() { $consulta =…
-
3
votes2
answers2411
viewsQ: Uncompressed data with Internet JOIN using PDO
Hello I’m having problems when I’m returning a select made with some tables Inner Join as shown below: So I set up a Join Internet with my needs in my method: public function tableUsuarioUM() {…
-
0
votes2
answers1185
viewsA: How to generate value by clicking on an input type Submit
@Diego Machado everything happened well I only put in the form the variables because the system is almost all that way so it was as follows: <div class="alert alert-error"> <form…
-
3
votes2
answers1185
viewsQ: How to generate value by clicking on an input type Submit
Form to send selected data for deletion. <form action="index.php?pagina=../controller/controllerUser&acao=ok" method="POST" enctype="multipart/form-data"> <label>Nome:</label>…
-
1
votes3
answers13476
viewsA: How to feed an input with a get variable in php
Solved simple problem. <?php $nome = (!empty($_GET['nome']) ? $_GET['nome'] : ''); ?> <input class="input" type="text" value="<?php echo $nome; ?>" name="nome"> Thank you.…
-
2
votes3
answers13476
viewsQ: How to feed an input with a get variable in php
Hello everyone all right I hope so, I’m with a relatively simple doubt, what I’m wanting is to use a file to make insertion and also change in php regarding the insertion is trackilo, well what I…
-
1
votes1
answer151
viewsA: Header cannot find past destination
Well I managed to solve, what apparently occurs is that my server of my application in the case APACHE he starts sending the response of request requested before actually arriving at the function…
-
4
votes1
answer151
viewsQ: Header cannot find past destination
I’m working on a project and function header cannot locate the destination passed to it. I have the following folder structure: On a certain form, I pass a action for: <form method="post"…
-
1
votes1
answer553
viewsQ: Insert into foreign key tables with PDO
How to insert into tables with one to many relationship containing foreign key Hello everyone all right I’m having a doubt, I have a relationship between two tables in my mysql data ban as follows:…
-
0
votes1
answer354
viewsQ: Best form Select tag in Php without framework with DAO project pattern
I have a question about the best way to implement a method that runs through a common select using DAO standard with PDO. It would be appropriate for me to do so, my entire code in the view:…
-
1
votes1
answer46
viewsQ: Insertion with non-standard characters
When I enter into Mysql database with PHP and PDO are entering strange and disordered characters, which may be wrong? Here is a picture of a bank table: My page has the parameter: <meta…
-
1
votes2
answers466
viewsA: Permission problem when trying to insert an image in a PHP directory
What was happening was that the directory was not being found, so I changed the following section in the code: move_uploaded_file($_FILES['fileUpload']['tmp_name'], "../uploaded/".$new_name);…
phpanswered André Martins 1,481 -
0
votes2
answers466
viewsQ: Permission problem when trying to insert an image in a PHP directory
I’m having trouble uploading an image to a directory, it seems I don’t have write permission. I’ve already added chmod 775 for the briefcase and nothing, which could be? I have my insert file this…
phpasked André Martins 1,481 -
2
votes1
answer370
viewsQ: PDO Selection in mysql database parameter BLOB
I am having trouble trying to rescue one or a list of images that I have already inserted in mysql 5 with PDO. I have a dao class that has the architecture of my querys to work with the database.…
-
0
votes1
answer636
viewsA: Inserting dates in php with PDO
As the staff passed me in the comments I solved the error as follows, I took the php.ini path in the terminalphp --ini soon after I added the following date.timezone = 'America/Sao_Paulo'p to…
-
0
votes1
answer636
viewsQ: Inserting dates in php with PDO
I am having trouble inserting a date in the bank with PDO. I have a mirror class in my table in the bank: class PaginaEntity { private $id; private $data; public function __construct(){…
-
1
votes3
answers215
viewsQ: Project Improvement in PHP
I’m having a question about the default php project. I have a class DAO which has a selection method, well what happens is that I had to put in this method some HTML code stylized with bootstrap,…
-
1
votes2
answers762
viewsA: how to concatenate values from a php session
good managed to solve changing some things thanks to the precious tips of the PHP Brazil community on Google+ my class is now as follows. <?php class Produto { private $nome; private $valor;…
phpanswered André Martins 1,481 -
1
votes2
answers762
viewsQ: how to concatenate values from a php session
Hello to everyone I’m having trouble to concatenate a session in php, what I intended would be the following a page to insert into an object, and then the values I would concatenate. my product…
phpasked André Martins 1,481 -
0
votes0
answers58
viewsQ: PHP 5.6 installed and phpinfo shows 5.5
I have a mac os x Yosemite and installed php even when I run php -v it brings me php 5.6 installed, the same is in the path /usr/local/Cellar/php56/5.6.5/bin/php that I added in the nano system path…
phpasked André Martins 1,481 -
0
votes1
answer258
viewsQ: Problem when trying to insert into mysql using PDO
I have a problem when I try to insert from a form <form method="post" action="../../controller/inserirContato.php"> <label for="name" class="nameLabel">Meu nome é: </label>…
-
1
votes2
answers201
viewsQ: I have doubts whether this would be the right way to make a connection using the PDO class
I’m wondering if this is really the right way to make a connection between php and mysql with the PDO class. The question is as follows: Each time I have a file that uses this connection it will…
-
3
votes1
answer1330
viewsA: Inheritance with jpa
Next create your persisntence.xml <?xml version="1.0" encoding="UTF-8"?> <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org…
-
1
votes2
answers2487
viewsA: .gitignore delete all folders but one
Hello try the following I yours . gitignore # Ignorar todos os diretórios e arquivos em um diretório. tmp/**/* I believe it solves.
-
1
votes1
answer146
viewsQ: How to have only one Adapter for various Activity?
I wonder if in any way or is it recommended to have a Adapter for each Activity. I know what to do with a Adapter for each Activity is quiet. Now how to make a Adapter generic, would have as? Would…
-
2
votes2
answers1390
viewsA: jpa jpql filter without using the primeface filter (with proper method)
Solved, the solution requires a little study rs but this is pretty cool and I think it’s worth putting here, so come on. What happens is that whenever I filtered the content it always went to the…
-
1
votes1
answer1508
viewsA: Jpa with Hibernate implementation does not generate postgresql tables
Step 01: Completely delete your schema in your database. Step 02: Make the necessary changes to your connection. <?xml version="1.0" encoding="UTF-8"?> <persistence version="2.0"…
-
3
votes1
answer512
viewsA: How to correctly sort a JSF <ui:repeat> tag
hello as I am using the bootstrap, so it was just an error of placing some tags follows as it got the code. <ui:define name="conteudo"> <h:form id="content"> <div class="row">…
-
2
votes1
answer512
viewsQ: How to correctly sort a JSF <ui:repeat> tag
I have a code put in the view view it’s coming out disfigured. <ui:define name="conteudo"> <h:form id="content"> <ui:repeat value="#{mbProduto.resultado}" var="prod"> <div…
-
3
votes2
answers1390
viewsQ: jpa jpql filter without using the primeface filter (with proper method)
Changed to likely solution however is not working yet, it seems to me that the line is not updated with ajax. <h:body> <h:form id="formTableProd"> <ui:composition…
-
1
votes2
answers1726
viewsA: exclusion of a database object with jpa 2 and jsf 2
After searching and of course with the help of the staff I got a satisfactory answer the instance of the object needs to be managed and I can do this with the meted merge or find and it is also…
-
2
votes2
answers1726
viewsQ: exclusion of a database object with jpa 2 and jsf 2
Well I’m trying to do a jpa deletion using jsf but I’m not succeeding. have my table. <p:dataTable value="#{mbProduto.produtos}" var="produtos" paginator="true" rows="10"…
-
2
votes1
answer1508
viewsQ: Jpa with Hibernate implementation does not generate postgresql tables
Good evening to all I am using Jpa with the implementation Hibernate to among other features generate tables, the problem is that from one hour to another the tables stopped being generated, someone…
-
0
votes1
answer2623
viewsQ: Moving circle on the screen with thread and jFrame’s Paint method
Studying the design method of JFrame in case the paint and wanted to make a circle move on the screen using threads, but the circle does not move right. Perhaps you would need a method movimenta to…
-
2
votes1
answer291
viewsQ: Problem with table extension in Postgresql, Person and Physical Person
I’m making an application that has a register of people, is a CRUD of Person that can be both physical and legal. the problem is that in my design should be created in the database a Pessoa and a…
-
3
votes1
answer5577
viewsQ: How to change the default postgresql schema in persistence.xml in a java application
I am developing an application and I have a certain difficulty to change the default scheme of the application. I am using Postgresql in a Java application with JPA and Hibernate as implementation.…
-
4
votes1
answer106
viewsA: How to leave a persistent CRUD?
You will need a database to save the information. If it is a robust application, I recommend the postgresql with the administration of pgAdmin along with the pgModeler to make relationships…
javaanswered André Martins 1,481 -
1
votes1
answer1873
viewsQ: Problem when inserting data into postgresql with jpa implemented by Hibernate
Good afternoon I would like to know why this error is happening, the project is with all the jars in the lib and in the path but when I will insert is returning me an error. Apr 19, 2014 4:49:27 PM…
-
3
votes1
answer1064
viewsQ: I can’t connect Jpa to Postgresql at all
Good I’m trying to connect the postgresql, however, without success. My application will be an application jsf and so I’m using persistence. <?xml version="1.0" encoding="UTF-8"?>…