Questions tagged as 'pdo'

1
answer

Why is the given $ variable not receiving the DB values?

<?php require'conecta.php'; $id = 0; if (isset($GET['id']) && !empty($GET['id'])){ $id = addslashes($GET['id']); $sql = "SELECT * FROM usuarios WHERE id = '$id'"; $sql = $pdo->query($sql); if ($sql->rowCount(...
asked by 04.02.2018 / 21:53
1
answer

Problem changing using pdo

I'm developing a system for college and am having the following problem Notice: Undefined property: stdClass::$Disciplina in C:\Users\lucas.vianna\Desktop\SGA\db\turmaDAO.php on line 64 Notice: Undefined variable: getDisciplina in C:\Users\l...
asked by 09.04.2018 / 15:45
1
answer

I am having trouble entering data into PDO

I have checked this code several times and I did not find the error, please help me find and correct ... echo"email = ".$email. "<br>" ; echo "ddd = ".$ddd ."<br>"; echo "telefone = ".$telefone . "<br>"; echo "cpf = ".$cpf ....
asked by 01.02.2017 / 12:11
1
answer

Error in query: 'SQLSTATE [42000]

I am doing data call of the database with php and PDO, but whenever I do it with bindparam(); it gives me the following error:    Fatal error : Uncaught exception 'PDOException' with message 'SQLSTATE [42000]: Syntax error or access v...
asked by 19.04.2016 / 12:50
1
answer

if within mysql show to create or insert [closed]

Good afternoon, I need to understand how an if inside mysql works so I can use it as follows. I have a foreach which only executes after a select database because it leaves an array for this foreach, in this foreach it will run a condition, i...
asked by 20.03.2016 / 22:03
1
answer

undefined index array pdo

I'm trying to get the id of a user that logged in and saved it in the session, but it's not working, I make a query in the database at the time of logging and I transform the result into an array to get the id and store it in the session , but t...
asked by 14.07.2016 / 01:21
2
answers

Login and Password with permission level in php

I am putting together a system to facilitate communication and support for the representatives of the company where I work. The rest of the page already exists, but I need to get each type of user directed to a different page. One of the bigg...
asked by 13.02.2015 / 17:01
1
answer

Avoid duplicate date and time for same scheduling professional

Friends I'm trying to create a schedule for a dental clinic, but I'm having a hard time avoiding the client scheduling a date and time that has already been scheduled for that selected professional. For example, someone has already scheduled the...
asked by 30.05.2015 / 04:22
1
answer

Accessing method (beginner)

I started my studies recently and a question arose about accessing information for a method. I have an X.php file that has the following structure: public function selectDB($sql,$params=null,$class=null){ $query=$this->connect()->pre...
asked by 22.03.2018 / 15:56
2
answers

Schedule of appointments using fetchAll (PDO :: FETCH_NAMED)

I'm using fetchAll (PDO :: FETCH_NAMED) to get the records from my database. I received the following array Array ( [0] => Array ( [idAgenda] => 2 [dataAgenda] => 1996-02-14 [lo...
asked by 23.05.2016 / 01:03