Questions tagged as 'pdo'

1
answer

A problem with variables in JS and PHP

I'm building a book registration system, it's quite easy actually, it only involves a bit of PHP and MySQL, but my problem is at the time of the display. See, it's a lot of information, so I wanted to make a button that would hide the selected b...
asked by 08.08.2016 / 20:56
1
answer

How to check the error "SQLSTATE [42S22]: Column not found: 1054 Unknown column"

I would like to know how I can check this error in my code "SQLSTATE [42S22]: Column not found: 1054 Unknown column" private $ Indo-national; public function RetornaIndoperacionais($ano){ if($ano == '2016'){ $_base = "pla_est_2016...
asked by 25.08.2016 / 23:03
1
answer

PDOStatement :: bindParam () blends the data

I have a class that does the insertion of records into a table. The data that comes from the request I transform into an array and then construct a SQL statement similar to this: INSERT INTO web_messages (pk_web_messages, fk_type_messages, nam...
asked by 14.04.2016 / 22:51
1
answer

Database Encoding - German Characters

I come across a strange situation, when I try to insert German characters (ä, ä) into the database they are inserted as follows: "üüü " The field is set to utf8_general_ci If you insert the data in a query directly into the dat...
asked by 02.06.2016 / 17:21
1
answer

Database - list table [closed]

How can I list all the DB table and put it in a table, list or any corner of the page?     
asked by 06.06.2016 / 13:46
1
answer

Concatenate in the PDO query

I've heard that concatenating a query using PDO can cause slowness and even make the system vulnerable, is that true? I want to concatenate in query and am afraid to take certain risks. public static function read($tabl...
asked by 19.02.2016 / 20:04
1
answer

How to do 1 only query and distribute the result spread by the code?

Well, I have a site where I am in each area using a select, so I think I'm doing more queries than I should, is there any way to get the result done? follows an image of what I'm proposing <?phptry{$sql="SELECT * FROM anuncios ORDER BY RA...
asked by 02.03.2016 / 19:15
2
answers

Error using $ this in static function

I'm trying to use a function from a class as follows: $database = database::select("SELECT * FROM eventos"); When I run the code, it returns me the error: Fatal error: Using this when not in context object in /var/www/html/folder/clas...
asked by 28.10.2015 / 22:53
1
answer

Value x input PHP

Code is this: Page editing: <?php $id = ""; $DsStatus = ""; if(!empty($_GET['id'])){ $id = $_GET['id']; $results = $controller->listar($id); $DsStatus = $results->getst(); } <form a...
asked by 20.01.2016 / 14:08
2
answers

Error saving data using PDO

I'm having a problem inserting data into the database using the PDO and I do not know why, as I see everything seems to be right, follow the codes below. Model class class User { private $id; private $nome; public setNome($nome...
asked by 06.02.2016 / 00:48