Questions tagged as 'pdo'

1
answer

error "login" method using php and pdo object orientation [closed]

Good afternoon, I'm having trouble logging into my restricted page ... SCREAM: Error suppression ignored for ( ! ) Fatal error: Call to a member function logar() on a non-object in C:\wamp\www\jauport\loginAdmin.php on line 85 Call Stack I'...
asked by 15.06.2017 / 20:23
1
answer

Problem with Insert and PDO

I'm trying to make an insert with PDO. For this I use: controller / com_clients.add.php <?php if($action == "new_client"){ $search_cod_cliente = $pdo->prepare("SELECT MAX(cli_cod_cliente) AS cli_cod_cliente FROM clients");...
asked by 06.01.2017 / 18:40
1
answer

Error Object of class daoMaterias could not be converted to string in daoMaterias.php on line 33

At the time of calling the function to register materials I encounter this error: Object of class daoMaterias could not be converted to string, Does anyone know how to solve? class daoMaterias { private $pdo; /* Funç...
asked by 28.10.2016 / 05:21
3
answers

Show Number of items per category in virtual store?

I have a question: I have several categories on my site and would like you to show how many items you have in each category. Example: You're like this: Accessories Toys Games Computers I want it to look like this: Accessor...
asked by 07.11.2016 / 12:27
1
answer

Editable line with PHP and Javascript

I'm trying to create an editable line, so when I click on it, Js brings me the inputs, allowing me to make the changes on that line and perform the Update in the database. As in this image, that prinlt of Trello. Note that it's a line, but...
asked by 29.09.2016 / 20:17
1
answer

How to sort query using PDO?

How can I sort my query from the most recent to the oldest date. Is this my Query? public function RetornaAtualizacoesFuncionarios($data,$codusuario){ $WHERE = array() ; if( !empty( $codusuario ) ) {$WHERE[] = "codusuario = $cod...
asked by 05.10.2016 / 20:04
2
answers

How to show the number records in PDO using COUNT (*)?

Hello,I'mdoingasystemthatliststhelatestupdatesinthedatabase,untilit'sallright,Ijustwantedtoprintthenumberoftotalupdatesthattheusermadetothetable.HowcanIdothis?Thankyouinadvance.TypemoreorlessusingSELECTCOUNT(*)ThisisthecodethatForeachdoes<?p...
asked by 05.10.2016 / 20:54
1
answer

How to use AND?

I would like to know where I can put AND tipregistro = 'mysql' so that when both !empyt and when you do not have tipregistro = 'mysql' this is my query public function RetornaAtualizacoesFuncionarios($data,$codusuario){...
asked by 05.10.2016 / 17:56
1
answer

Is it possible to select a table column without entering its name in SQL?

So I was searching but I did not find anything about it, but I need to sort the first and second columns of the table without knowing what they are. My code is this: <?php $preparaNormalizacao=$con->prepare("SELECT * FROM ".$tabelaExtern...
asked by 19.06.2016 / 00:18
1
answer

Error Insert in bank using PDO: "Only variables should be passed by reference" [duplicate]

I'm passing insert parameters to the database using PDO and O.O, but giving the Insert command using the $stm->bindParam(1, $usuario->getnivel()); parameters returns error saying that I should only pass variables to insert. Fol...
asked by 26.03.2016 / 17:53