Questions tagged as 'pdo'

0
answers

You are not writing information to the database

When informing client data to be registered in the database, it simply does not record and does not show any errors, I believe the error is here if($site->inserir('loja_clientes', $dados)) But if not, how can I resolve this? si...
asked by 15.10.2017 / 11:38
0
answers

Back-End MVC (Laravel) Real Time with Json

I did a Laravel course, and I did my application in MVC, however, there are balloons, which I load in JSON, click the "login" button, open the login balloon, there are CRUD functions. can I do the MVC system in this way? The balloons are in the...
asked by 26.08.2017 / 17:22
1
answer

Problem returning data with PDO from MySQL

I have a query that returns the permissions of a certain group of users on my system. I use MySQL with PHP. My SQL command is as follows: select p.Codigo, p.Descricao, (case when gp.CodGrupoUsuario is null then 0 else 1 end) as TemPerm...
asked by 12.08.2017 / 23:55
0
answers

What is the best way to store an array in a single field in the database

Generally, implode/explode or serialize/unserialize is used to store multiple information for a particular item in the database. Using PDO, what would be the best and if there is another way to store an array in a single database f...
asked by 24.07.2017 / 22:36
1
answer

Error Insert in bank using PDO: "Only variables should be passed by reference" [duplicate]

I'm passing insert parameters to the database using PDO and O.O, but giving the Insert command using the $stm->bindParam(1, $usuario->getnivel()); parameters returns error saying that I should only pass variables to insert. Fol...
asked by 26.03.2016 / 17:53
0
answers

bindValue With or Without data_type?

I'm trying to insert some data into my database, id is set to ìnt and the rest all varchar , and I get this error:    Catchable fatal error: Object of class stdClass could not be converted to string in C: \ wamp64 \ www \...
asked by 29.06.2017 / 19:36
1
answer

Error query pdo (Sort by count) [closed]

I'm trying to make a ranking based on the amount of coins in each. In descending order. I used this query in pdo: $ranking = $pdo->query("SELECT * FROM usuarios WHERE banido='false' GROUP BY usuario ORDER BY count(moedas) DESC LIMIT 3");...
asked by 29.06.2017 / 20:51
1
answer

Retrieves values using classes and pdo without going through the url

Good afternoon, I have a class where I pass all methods insert , update , delete , consulta(fechall) and consulta(fech($id)) Below I show the class of consulta(fech($id)) public function selId($id){...
asked by 06.06.2017 / 21:57
3
answers

Search name by first and last name

I'm having a hard time crafting a query MySQL to search for a name, so the person can type the first and last name and accept another name among them. For example: Search: 'JOSÉ NUNES' or 'NUNES JOSÉ' Result: JOSÉ SILVA NUNES The way...
asked by 06.06.2017 / 20:46
1
answer

Connection error using namespace

I have a file that is responsible for connecting to DB and is in PDO. <?php namespace clientes\model; class conexaoPDO { public static $instance; private function __construct() { } public static function getIntance() { if (!isset...
asked by 26.06.2017 / 22:15