Questions tagged as 'pdo'

1
answer

Viewing image saved in PHP / Restaurant bank

$pdo->bindValue( ':img_prato' , $_REQUEST['img_prato']); = profile-sw.jpg How do I display the Image, not the path? Insert.php <?php require_once 'usuario.php'; require_once 'autenticador.php'; require_once 'sessao.php';...
asked by 19.05.2015 / 09:16
1
answer

Handling Data Array PDO CRUD

Lista-prato.php: <?php //inclui as bibliotecas require_once('conexao.class.php'); //faz a canexão $pdo = new Conexao(); // determina o numero de registros que serão visualisados $maximo = 20; // armazenamo...
asked by 18.05.2015 / 05:16
1
answer

PDO Switch Case Does Not Display

Changed more within the title yet, the case works but does not display the result. <?php $sql = "SELECT tipo FROM publicidade WHERE posicao='Lateral' ORDER BY RAND() LIMIT 1"; $stmt = DB::prepare($sql); $stmt->execute(); $exibe = $stmt-...
asked by 10.03.2015 / 18:09
1
answer

What is the purpose of creating the folder and not uploading the image in sequence? [closed]

if ($_POST['salvar']) { $titulo = $_POST['titulo']; $conteudo = $_POST['conteudo']; $imagem = $_POST['imagem']; // titulo duplicado $sql = "SELECT * FROM noticias WHERE (titulo=:titulo)"; $stmt = DB::prepare($sql); $stmt->bindParam("titulo",...
asked by 04.01.2015 / 00:53
1
answer

How to return only the last result of more than one field from the same table?

I'm trying to make a PM's system in php script I want to make a list of unread messages but want to show only one entry (the last) of each user sending a message ... in the script that did shows all unread but shows more than one of each user (i...
asked by 01.04.2015 / 01:22
2
answers

How to query multiple columns

How can I query multiple columns for the equal field value using the PDO $PDO = db_connect(); $busca = $_POST['campo']; $vbusca = array("%$busca%"); $sql = 'SELECT * FROM livro AS t WHERE nome LIKE ?'; $stmt = $PDO->prepare($sql); $stmt-...
asked by 17.12.2018 / 19:17
1
answer

Problem creating a connection between PHP and PostgreSQl [closed]

I am not able to connect to the PostgreSQL database. Here is the code: <?php class Conexao { private $usuario; private $senha; private $banco; private $servidor; private $porta; private static $pdo; //Método co...
asked by 19.12.2018 / 14:32
2
answers

Insert with two tables

Follow my code, the first query with the student table information. Second query with Payments table information. In my registration, I have student information and payments together. I want to register the two tables at the same time....
asked by 03.10.2018 / 18:49
1
answer

LIKE with PDO explode [duplicate]

Good evening consecrated, I have a search page, in which I want when someone searches for something like "i3 memory cabinet display" to appear all the items available in the table with respect to these items searched, so I should use the explo...
asked by 11.10.2018 / 02:44
2
answers

Show Value in Json + Mysql + PHP

I need to do this, but coming from the database .... I do not know how to do it function decodificar($id) { if ($id == '1') { return json_encode( array( 'id' => '1', 'desc' => 'descricao do produto',...
asked by 17.09.2018 / 17:45