Questions tagged as 'pdo'

1
answer

Like postgres PDO with foreach

I need to use a like in foreach but without success, I did the following: $arr = array('\'%a%\'', '\'%b%\'', '\'%c%\''); foreach ($arr as $a){ $this->SQL = "update client set active=1 where date between ? and ? and type like ?" $this-...
asked by 09.08.2016 / 18:38
1
answer

PDO Help Using MySQL

I am having trouble connecting to the database using PDO, I use MySQL. When I run the connection to the database, the following error messages appear:    Fatal error: Uncaught exception 'PDOException' with message 'in C: \ wamp64 \ www \ p...
asked by 24.11.2016 / 21:52
1
answer

Result PDO Search PHP Does not return a field

I make a sql query using PHP PDO. When checking the result of the query, the value of a field returns empty, but the field has value. Using the SQL statement directly in phpMyAdmin the result returns normal with all fields. I've never seen th...
asked by 22.06.2016 / 21:11
1
answer

Handling postgres query errors [closed]

To use PDO and Postgres, but with difficulty to catch the exception of the query, such as error in the syntax. I am grateful for a light!     
asked by 19.05.2016 / 17:08
2
answers

Problem inserting data into DB with PDO

My error: Fatal error: Call to undefined method DB :: prepare () in C: \ xampp \ htdocs \ atTheClub \ adm \ classes \ houses.php on line 36 Files: houses.php class casas extends Crud{ %pr_e% } crud.php require '...
asked by 26.04.2016 / 15:56
1
answer

Problems searching php pdo

I'm doing a search field but it returns me some errors. My code: class Prog{ private $DtBase; public function setdata($DtBase){ $this->data = $DtBase; } public function getdata(){ return convertarData($this->data);...
asked by 22.03.2016 / 13:39
1
answer

Retrieve an overall rating and display in a list

Good evening guys, I'm in the following situation, I have a table called cars, and each car can be evaluated by different users, so I have created a secondary table called ratings and each car can be evaluated by several different users. N...
asked by 07.05.2016 / 00:13
1
answer

Problems instantiating the object

public function select($sql, $array = array()) { $sth = $this->conn->prepare($sql); if(!empty($array)){ foreach ($array as $key => $value) { $sth->bindValue(":".$key, $value); } } $this->...
asked by 16.05.2016 / 04:57
1
answer

Catch information from a foreach with another foreach

I have a mysql search that brings me the following array when using a foreach, I have another sql search that brings me all the fields of a table that in case they are the same field names that are below usr_tbl_ssid ... how do to display only t...
asked by 23.04.2016 / 12:10
1
answer

Can I make more than 1 insert using PDO?

I want to do more than 1 insert using PDO and a php file, can I? Example: <?php ini_set('display_errors', true); error_reporting(E_ALL); header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Methods: GET, POST, OPTIONS');...
asked by 01.02.2016 / 19:17