Questions tagged [PHP PDO] (450)

2
answers

Zend Framework, MSSQL 2008 R2 PDO -> lastInsertId insert?

How to get lastInsertId if you do in Sehnde$model->insert(array(<br> 'data1' => $data1<br> 'data2' => $data2<br> ));<br> $model->lastInserId(); — not working...
Gennaro.Ebert asked October 10th 19 at 06:20
1
answer

PDO: INSERT array into table

For mysql to insert many rows need to run something like INSERT INTO ids VALUES (0, 'http://url1.ru'), (0, 'http://url2.ru'), (0, 'http://url3.ru'); so here's the problem: have an array and need to insert into the plate. He is one-dimensional and assume that the column in the table too. Is there any PDO function to imp...
woodrow_Hintz asked October 10th 19 at 05:40
11
answers

How to connect PDO to Php-fpm?

The server has Nginx which forwards requests to Apache and php-fpm. In php.ini connected PDO extension=pdo_mysql.so phpinfo() on the websites running on apache shows PDO drivers ->mysql phpinfo() on sites running on php-fpm shows PDO drivers -> no value OS is ArchLinux. Why php-fpm does not connect to the PDO driver...
Addie.Ebert asked October 7th 19 at 13:06
1
answer

PDO. exec + query = exception

Code: $db = new PDO($dsn, $user, $pass); $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $db->exec('select version()'); $db->query('select version()'); Throws Exception: General error: 2014 Cannot execute queries while other unbuffered queries...
mina_Lyn asked October 3rd 19 at 17:49
4
answers

Is there a simple way to handle the situation 'DATABASE IS LOCKED' when you access SQLite from PHP?

At www.php.net/manual/en/pdo.begintransaction.php the review recommended that this method of registration of transactions when accessing SQLite database:<?php $conn = new PDO('sqlite:C:\path\to\file.sqlite'); $stmt = $conn--->prepare('INSERT INTO my_table(my_id, my_value) VALUES(?, ?)'); $waiting = true; // Set a loop...
johanna_Fries asked October 3rd 19 at 17:13
9
answers

Calling a stored procedure with php PDO firebird

Hello. You cannot perform a HP handle. The procedure itself: CREATE PROCEDURE P_NAME_ID( INTAB VARCHAR(10), NAME VARCHAR(60)) RETURNS ( ID INTEGER, PNO SMALLINT) AS DECLARE VARIABLE UPNAME VARCHAR(60); begin if (INTAB = 'TGOS') then begin if ( NOT EXISTS(select ID from TGOS where UPPER(GOS) = :UPNAME) ) then begin in...
Ara32 asked October 3rd 19 at 08:26
2
answers

How to make an output with the condition of MS SQL Server 2005 via PDO?

Hi all, Faced with such a problem. Need to get data from a database using PDO. You have user class with functions that output the data.public function select($sql, $array = array(), $fetchMode = PDO::FETCH_ASSOC) { //try... if not catch exception try{ $sth = $this->DBH_->prepare($sql); foreach ($array as $key =>...
nedra1 asked October 3rd 19 at 02:05
1
answer

MS SQL Server Windows Authentication on Linux (Ubuntu) and PHP?

There is a task to connect to MS SQL Server from Ubuntu using c PHP script. But there's only 1 way to connect to the database - Windows Authentication. If someone faced, prompt, please, the solution to this problem.
thea.Heller89 asked October 3rd 19 at 01:28
2
answers

Why PDO question marks instead of Russian letters when you insert data in the database?

In php I use pdo to connect to database, in php file , in mysql a comparison mode utf8_general_ci, use this code: $db = new PDO("mysql:host=localhost;dbname=site", "root", "123"); $db->exec("SET NAMES utf8"); $stmt = $db->prepare("INSERT INTO news (title, text, date) VALUES (?, ?, ?)"); $stmt ->execute(array($_GET[...
Sophie74 asked October 3rd 19 at 00:12
1
answer

sqlite3 + aes256 + php4.2

If you create a database with aes256 even if there is 'aes256:key' (where key - key with which I created the database) parameter when creating an instance of the class PDO get the error SQLSTATE[HY000]: General error: 26 file is encrypted or is not a database Actually if you create a database with aes128 that the situation ...
willis36 asked October 2nd 19 at 22:45