Questions tagged as 'pdo'

1
answer

How to intercept the result of a query?

I need to test whether the query you have done is fine or you hear something wrong. I have tried to find something that does not satisfy what I need. Example: I submitted a sql in the database, and it was done correctly, but I heard an err...
asked by 06.12.2015 / 13:14
3
answers

Insert into bank with function

I'm trying to make an insert into the database using a function but I'm not able to enter its values; HTML: <?php if (isset($_POST['submitTexto'])) { inserir('empresa', $_POST); } ?> where sub...
asked by 10.08.2015 / 16:29
1
answer

Return mysql result with function

I'm trying to list a database table using a function but I can not use it outside of function : The HTML: <tbody> <?php listar('empresa'); ?> <?php foreach ($row as $listar): ?> <tr> <td><...
asked by 10.08.2015 / 19:23
1
answer

SQL LIMIT always returns the same last 3 records

I have a problem with a select. I have the following table id id_de id_para mensagem --- --------- ----------- ----------- 1 10 20 Oi David. 2 20 10 Oi José 3 10 20...
asked by 18.06.2015 / 02:03
2
answers

Multiple image file

There I come to you for help novalmente! I created a function to register images in the database, one of them being the cover and the rest of the album images. The script even registers the cover image and album, but the album is only registe...
asked by 18.09.2015 / 22:00
1
answer

Problems with SELECT option with PDO

Friends re-edited the PDO connection below: <?php $conn = new PDO( 'mysql:host=localhost;dbname=pbfjacar_site' , 'pbfjacar_murilo' , 'smc100164' ); $stmt = $conn-> prepare('SELECT font FROM fontes'); $stmt-> execute(); $result = $stmt...
asked by 10.05.2015 / 03:17
1
answer

Create folder and upload file during the same insert

I want to insert a story together with the image file in a single post, the problem is that I would like to create a folder with the news ID where the image will be stored. Is it happening that the insert is running plus the upload, not some lig...
asked by 18.02.2015 / 20:50
1
answer

PDO Selection in the database mysql parameter BLOB

I'm having trouble trying to retrieve one or a list of images that I've already inserted into mysql 5 with PDO. I have a class of what has the architecture of my querys to work with the database. class ImagemDao { public function inserirImage...
asked by 21.04.2015 / 23:18
1
answer

Is FluentPDO safe?

Someone who has already used FluentPDO , can you tell me if it's secure against SQL Injects? It's okay that it uses PDO, but it suddenly does not handle the data before it is sent to the database. And if it is secure, I want to study it to d...
asked by 24.03.2014 / 20:48
2
answers

Single database instance

I have a controller and need to access 2 or more tables from my database, eg: $userModel = loadModel('userModel'); $userModel->setTable('users'); $userModel->getAllUser(); $outroModel = loadModel('outroModel'); $outroMode...
asked by 23.05.2014 / 20:43