Questions tagged as 'pdo'

0
answers

Make insert with select

I have a table named label, with varcharTag name and quant int 11. When I insert into the label table, I have to increase the total quantity registered in bank +1 . But I do not know how to do this without having to do another query over and...
asked by 28.11.2017 / 16:31
0
answers

Upload with php - problem with charset

I have a problem that has been disturbing me for some time. I have a page for simple image upload, the page is on charset utf-8 and the firebird database on iso8859-1. The reason for the system being in utf-8 is that all the plug-ins I use fr...
asked by 28.11.2017 / 20:59
1
answer

Why this "Call to undefined method Database :: Prepare ()" error in PHP 5.2?

I am using the following class to connect to the MySQL database class Database { private static $link = null; private static function getLink() { if (self::$link) { return self::$link; } $ini...
asked by 17.11.2017 / 20:21
1
answer

Prevent duplicate records in left outer join

I have tried to use distinct but without success ... result should be SELECT distinct prd.ID_CPF_EMPRESA, prd.prd_codigo , prd.cat_codigo , prd.prd_descricao, prd.prd_preco , prd.prd_img , prd.prd_det_1 , prd.prd_det_2 , prd.prd_ativo , IFNULL...
asked by 31.10.2017 / 19:26
1
answer

I can not display populated data in divs separated by columns

I want to display data from a table by divs with columns of a specific size for each of them, but when I load the information it brings all of them into the same column, I do not want to use table tags to format them. See how it's popping up her...
asked by 28.10.2017 / 02:56
1
answer

PDL unlink help

I'm trying to migrate MYSQL to the PDO, and I came across a problem with Unlink. With the code below I can do the UPDATE in the BD Banner table, and also store the new file in the destination folder (img_banner), but not replacing the previou...
asked by 03.11.2017 / 00:42
1
answer

Difficulties with PHP - lastInsertId () [duplicate]

I'm having trouble getting the last id inserted in my table using the php function PDO lastInsertId() How do I get the last id inserted in my table using my structure?    Connection to the bank class ConnectionDB{ private functio...
asked by 10.11.2017 / 00:59
2
answers

MySQL while switching from PDO foreach

I'm trying to migrate the files with the MySQL Functions to the PDO. But I can not loop the images with the code below. <?php $sql = $pdo->prepare("SELECT * FROM banner"); $sql->execute(); foreach($sql->fetchAll() as...
asked by 02.11.2017 / 04:49
2
answers

PDO Insert Record

I'm having issues with the insert tag in the database with PDO , below it follows tabela and script : table calendar CREATE TABLE 'calendar' ( 'id' int(11) NOT NULL, 'title' varchar(255) CHARACTER SET latin1...
asked by 08.10.2017 / 15:48
1
answer

Create database through PDO

I have a project in mind, in which I would like to create a database with the name of variables, and in case it would be checked to see if the DB was already created, it would look something like this: if ($pdo=new PDO ("mysql:host=localho...
asked by 09.10.2017 / 17:08