Questions tagged as 'pdo'

1
answer

How to make multiple execute with PDO

I have a very simple user update form, but I'm not able to successfully update using PDO and mysql. Here is the snippet of code I'm having trouble with: if (isset($_POST['ID'])){//Se informar o ID do usuário que deseja modificar $senh...
asked by 23.10.2017 / 13:01
1
answer

Error inserting data into PHP database PDO [duplicate]

I'm trying to create a new database in the database with the following code and returns the error: Insert value list does not match column list or the registry is created but blank, the fields are NOT NULL, I already tried other options here i...
asked by 13.12.2017 / 20:05
4
answers

How do I do a SELECT then an INSERT [closed]

How do I do a SELECT and if it returns more than 1 record does the UPDATE and if it returns 0 records does the INSERT? Look how I've done here but it's not working: if(isset($_POST['submit'])){ $query = $conexao->prepare("SELECT id_m...
asked by 15.12.2015 / 21:19
1
answer

Connection to mysql by pdo does not exist

I can not connect to my database, I have no errors, the connection just does not happen, it just gives me a blank page. I have these 4 small files responsible for the. init.php: <?php session_start(); $GLOBALS['config'] = array( 'my...
asked by 25.04.2014 / 11:13
2
answers

How to generate error in logerro.txt file?

I'm trying to generate errors in the logerro.txt file, but I do not know how to do it. I used the syntax error function but: try{ }else(PDOException $e){ echo'Sistema indisponível'; LogErros($e); I used the above function and gave...
asked by 06.11.2014 / 05:54
1
answer

PDO Help (PREPARE)

Hello. I'm trying to make a CRUD using PHP OO. But when I run I get error in prepare of the PDO class. I have only for the moment the registration code in the bank and the connection code to the bank: Banco.php <?php class Banco{...
asked by 28.01.2017 / 21:25
1
answer

Using mysql_num_rows with PDO [closed]

I changed the method of connecting my page to my Database via PDO. I used until then a paging code but it is now returning the error:    Warning: mysql_num_rows () expects parameter 1 to be resource, string given in D: \ xampp \ htdocs \ n_ar...
asked by 09.08.2018 / 19:44
1
answer

How to fetch all records in the database?

   Help me out! $BuscaProdutosAtivos = $pdo->prepare("SELECT * FROM tbl_produtos p INNER JOIN tbl_categorias c ON c.cat_id = p.prod_categoria INNER JOIN tbl_vari...
asked by 26.11.2014 / 01:27
1
answer

How to return the id of the user who is in the session

require_once('conexao.php'); @$email = $_POST['email']; @$senha = md5($_POST['senha']); // $email = "[email protected]"; // $senha = "12346"; $pdo = $dbconn->prepare("SELECT userid, nome, nivel FROM usuario WHERE email=:email and senha=:...
asked by 17.03.2018 / 23:13
2
answers

Move row to another table in PHP PDO database

I have a movie table on my site that you have the option to edit and delete. I'm having trouble deleting the movie from my table. What I want to do is: When you click Delete, it moves the row to another table of the same type, doing backup. Afte...
asked by 21.11.2018 / 01:54