I've been reading about preventing sql injections and seen using prepared statements might help.
I have the following function in a class for crud that I have developed:
public function inserir($tabela, $campos, $dados) {
try {...
I am building a simple webservice and PHP + JSON where I have 2 tables and intend to carry out CRUD operations. It is possible that the medium-term webservice consumed by many devices at the same time, which in my opinion can lead to many concur...
Via PDO , I can do the TRUNCATE (English) of a table as follows:
// Matriz de definições
$dbcon_new = array(
"host" => "localhost",
"dbname" => "bubu",
"username" => "super_dragon",
"password" =>...
In the php snippet below, what kind of PDO :: PARAM should I use?
$cnx = new PostgreSQL(); //Classe de conexão do banco
$data = '2015-02-13';
$select = 'SELECT * FROM eventos WHERE "data" = :data';
$query -> prepare($select);
$query -> b...
I am using the PDO class to connect the database but in this particular situation I do not know how to use the PDO because in the mysql_fetch parameter I need to put a variable and for what I researched with the class PDO it is not the same way....
I'm trying to create a function that takes 1 value from a input do tipo texto and 1 file.
I was able to move the file to the folder however I am not able to develop SQL to insert the file name into the database.
The ID and name is u...
I have a problem that I could not resolve. I already researched here and found nothing like it.
I have an application in PHP, using the class PDO to connect to the database.
Then I have the CRUD: SELECT , INSERT , UPDATE E...
I'm trying to make a select with inner join . Running the select in phpmyadmin the ERR that returns is this:
Column 'idusuario' in where clause is ambiguous
<?php
$idusuario = $_GET['idusuario'];
$getCli=...
I need to connect to a Progress database via php I'm using the laravel 5.2 framework but the same documentation supports only the MySQL, Postgres, SQLite and SQL Server databases.
Searching I found very little about how to connect to this DB...
I would like to make sure that after the script runs, there may only be the last 12 records in a specific table that has the date field in international format if you can assist.
<?php
# Este pequeno script PHP recupera o OD do imóvel visi...