Questions tagged as 'pdo'

1
answer

How to link tables that are in different databases?

I would like to know how I can link two tables that are in different databases in order to find data that is similar in both tables. For example, we can have the Purchasing to-do list table and Purchased shopping list table table, to end...
asked by 09.01.2018 / 08:35
2
answers

PDO does it use syntax of some DBMS or do they all work?

When considering PDO usage , one of the key usability is the scope of multiple databases . Example scenario Different ways to filter 5 records, which vary depending on the database: SELECT TOP 5 campo FROM tabela SELECT campo FROM ta...
asked by 03.10.2018 / 13:35
1
answer

How to perform a paging with PDO?

I'm developing an application in PHP but I just started in PDO and I have no idea how to make a paging using it. I was able to set up a small query with example of the information to be printed and would like an help to f...
asked by 03.10.2014 / 18:00
3
answers

Use prepare statement in a constant value?

$type = 'post'; $stmtPG = $conn->prepare("SELECT count(*) FROM myTable WHERE entry_type = :type"); $stmtPG->bindParam(':type', $type); $stmtPG->execute(); $total = $stmtPG->fetchColumn(); $total_paginas = ceil($total/$maximo); Ther...
asked by 24.09.2018 / 17:24
1
answer

SQL Server PDO error: There are no more rows in the active result set. Since this result is not scrollable, no more data may be retrieved

I'm trying to get records from a table and write to another of the same type, but I'm having this error:    There are no more rows in the active result set. Since this result set is not scrollable, no more data may be retrieved. The code...
asked by 27.04.2017 / 17:15
1
answer

When relating two tables, is the correct side of SQL, PHP or whatever?

I have this doubt of what it is preferable to do when I need data from the two tables to get the result. I always did the comparison in PHP, but I learned the SQL relationship commands that could help. What is the most correct way to do it, p...
asked by 17.12.2016 / 21:44
1
answer

How PDOStatement :: fetchObject works

I'm trying to set the values returned from a query to an object of another class as follows: public function select($id,Cliente $cliente) { $query = "SELECT * FROM compras WHERE id = :id AND email = :email"; $stm = $this->conexao-&g...
asked by 07.10.2016 / 18:21
2
answers

How to list specific data from a table with PDO?

How to list specific data of a table, but using PDO ? I'm starting to study and use PDO , but some things I can not find and that are well explained how to lite the data with a WHERE in the search. MySQLi is used this way, but...
asked by 04.02.2016 / 20:10
2
answers

How to work with authorization levels with PHP? [closed]

I am putting together a school report system to train my skills in php. And I'm having a hard time. It is the following: I have 3 types of users: teacher, admin and student. The teacher can put note and change the note, but this note is only...
asked by 02.01.2017 / 16:01
1
answer

How to perform UPDATE with PDO in PHP?

So folks, I wanted to redeem the data to edit in update.php , but how much lost here, how to give a force? <div class="container"> <div class="table-responsive"> <table class="table"> <tr>...
asked by 10.12.2015 / 17:35