Questions tagged as 'pdo'

0
answers

How do I pass information in the bindvalue with two or more information stored in the variable?

I'm having a problem ... I'm getting some id in the database and storing it in $ids_cozinha . I gave var_dump and print_r , I'm returning the ids I want, so far so good. <pre> <?php print_r(implode(", ",$ids_cozinha...
asked by 22.11.2018 / 18:45
0
answers

Generate PHP dynamic menu and submenu

I need to generate a dynamic menu based on certain permissions. My structure looks like this: I have three tables: -------------+-------------+------------ [Menu] | [Usuario] | [permissao] idmenu | iduser | idper nivelmenu...
asked by 08.11.2018 / 20:28
1
answer

Problem with Expense Calculation with PHP

I'm trying to make an expense calculation on the system but I'm not having success. The system works as follows, the User makes a request involving 1 or more products, these requests are stored in a table. Each Product registered in the system i...
asked by 01.11.2018 / 22:25
1
answer

insert only one field with pdo

Hey guys, my problem is the following I'm using the PDO object of php to insert records in the database, the problem is when I try to insert only one field in a table example: $query = 'INSERT INTO alunos (nome) VALUES(:nome)'; $stmt= $...
asked by 04.10.2018 / 16:54
0
answers

Error in function to list user data

I'm having the following error while listing a user's data with the lista() function.    Parse error: syntax error, unexpected 'name' (T_STRING) in   /home/adelanmu/public_html/user-class.php on line 54 public function lista(){ $...
asked by 21.09.2018 / 18:52
1
answer

Is it recommended to use a global variable for a PDO object?

Below I'll give you an example of how I use the PDO connection today to access my databases. I would like to see with you, whether it is a good practice this way, or whether it is recommended a safer and more efficient way. For example: <...
asked by 14.09.2018 / 16:33
1
answer

Problems inserting data into multiple tables using pdo

Hello, my case is as follows, when the tables are empty all fields are normally inserted more if I try to enter more data the system returns an "alert" that an error occurred while registering. public function queryInsertPj($dados){ try{...
asked by 12.09.2018 / 14:53
0
answers

PDO DAO PHP doubts in insert

I'm trying to make an insert using pdo and dao, I have little knowledge in case, I made it on top of a template that works fine, but when I do with more fields and another bank the code does not give error but returns nothing and do not insert....
asked by 14.09.2018 / 06:10
1
answer

PDO Error - Call to a member functio on null

I created a function to make a query in the DB and return a User from the variable $nome passed by parameter, however, when testing it it enters the else, would anyone know where the error is? Note: The PDO connection is working and the...
asked by 09.09.2018 / 02:21
1
answer

Change variable in UPDATE PDO PHPERRO: PDOStatement :: execute (): SQLSTATE [HY093]

@$c_matricula = $_POST['numero']; @$data_aa = $_POST['data_aa']; @$data_ff = $_POST['data_ff']; if(isset($data_aa)){ @$dataa = date("Y-m-d H:i:s"); $pdo = $dbconn->prepare("UPDATE contato SET c_data_andamento = :data_a WHERE c_matri...
asked by 15.09.2018 / 23:22