Questions tagged as 'pdo'

1
answer

Problem with authentication in PHP, returns PDO :: errorCode (): 00000

I have a problem to authenticate a website with php, when I put the data in the form it returns the error message that I enter if it crashed and another errorCode 0000 message in the login method. Apparently I did not find any syntax errors or a...
asked by 03.11.2016 / 03:19
2
answers

What is the difference of bindValue for an array executed directly in $ pdo-execute ()

I currently use a schedule like this <?php $array = array('nome'=>'Alisson', 'idade'=>20); $query = $conn->prepare("INSERT INTO table (nome,idade) VALUES (:nome, :idade)"); $query->execute($array); ?> What's the differe...
asked by 18.12.2015 / 02:52
1
answer

How to do query in Pdo by date using input month?

I'dliketoknowhowIcanmakeanappointmentforthemonthyou'vechosenalongwiththename.TypeifIchooseAugustitwillonlycomeAugustmonthandsoon.ThisisthequerypublicfunctionRetornaAtualizacoesFuncionarios($data,$codusuario){$WHERE=array();if(empty($codusuario)...
asked by 04.10.2016 / 14:48
1
answer

Write JS to the database with $ _POST

Hello. I have a PHP script that executes an INSERT in a table in my database. The $ _POST array [txt_message] shown in the code should accept JS content, but it gets empty after the submit. It should accept for example a simple alert ('ola...
asked by 28.09.2016 / 19:28
0
answers

MySql SUM function and return data

The function below does not return me as expected. I want it to return a sum and the fields with the id of the collaborator, however in JavaScript I get an error, and I believe it is in PHP. The select works fine by running directly...
asked by 13.09.2016 / 23:09
0
answers

Error inserting multiple lines PHP + PDO + POSTGRESQL

I am using the multiple insert, but the internal characters of the text have made the insert fail. I used the addslaches method in the string but the error remains, any suggestions of what I can do to get around? I have the following code...
asked by 22.08.2016 / 16:57
0
answers

Login Username PHP

I am making the following code PHP public function Login($uname,$umail,$upass) { try { $stmt = $this->conn->prepare("SELECT usersid, user, email, password FROM user WHERE user=:uname OR email=:umail"); $stmt->b...
asked by 17.08.2016 / 23:00
1
answer

How do I mount pair of array key vaue to insert into table?

$key = "id,name"; $val = "'$lastid','$autor'"; ... if ($email){ $key .= ",email"; $val .= ",'$email'"; } ... $keys = \explode(',', $key); $vals = \explode(',', $val); $arr = array_combine($keys,array_fill(0,count($keys),$vals)); .... //O a...
asked by 10.09.2016 / 01:02
1
answer

Insert with SQLSTATE error [HY093]

I am making a form to save data in the database and this error Erro SQLSTATE [HY093] <?PHP $nome = $_REQUEST['Nome']; $cpf = $_REQUEST['CPF']; $sexo = $_REQUEST['Sexo']; $datanasc = $_REQUEST['DataNasc']; $telefone = $_REQUEST['Tele...
asked by 07.08.2016 / 18:14
2
answers

Error instantiating two or more PDOs in different classes

I'll start with the displayed error:    Fatal error: Uncaught PDOException: You can not serialize or   unserialize PDO instances in [no active file] on line 0 In the project I have the Carts class and the Tags class, both are subcla...
asked by 15.08.2016 / 18:31