Questions tagged as 'pdo'

1
answer

Help with Combo Box with Ajax

I used a YouTube video lesson to create a Combo Box for States and Cities, but I followed the reasoning of the STATES.PHP page and I inserted it in the CITIES.PHP page and created the BAIRROS.PHP page, but I did not succeed because when I enter...
asked by 12.11.2017 / 18:03
1
answer

How to make an INNER JOIN with two tables in different banks?

I have two different banks that I make the connection in the following way: date_default_timezone_set('America/Sao_Paulo'); abstract class BancoDados { const host = 'localhost'; const novoweb = 'novoweb'; const WebAccount = 'Web_Account'; cons...
asked by 15.12.2017 / 17:27
1
answer

I can not return all the data in the inputs with the PDO?

I created a page to put cpf and soon after it does a search in the bank, and it brings the data according to the cpf typed. but there are some inputs that are not returning as <radio> (sex M or F), <select> are a...
asked by 18.11.2017 / 01:58
2
answers

Column 'ActiveCirculatingTotal' can not be null

I'm finding it very strange what's happening because yesterday worked perfectly! I have created the following code:      require_once 'credenciais.php'; //pega dados do formulário de ativo e passivo circulante $ac = isset($_POST['ac']) ? $...
asked by 26.10.2017 / 17:36
1
answer

Why the error in PDO Uncaught Error: Call to undefined method PDO :: fetch ()?

I do not know why this error occurred.   PDA :: fetch () in /opt/lampp/htdocs/myschool.com.br/login.php:24 Stack trace: # 0 {main} thrown in / opt /lampp/htdocs/myschool.com.br/login.php on line 24 PHP use dao\Connection; session_start...
asked by 11.10.2017 / 18:21
1
answer

Insert JSON file into the database via PHP

I have a JSON file that I need to insert the information contained in it into the database. JSON file: {"retorno":{"produtos":[{"produto":{"codigo":"AAAAAA","estoqueAtual":20}},{"produto":{"codigo":"BBBBBB","estoqueAtual":10}}]}} How I'm...
asked by 26.10.2017 / 21:38
3
answers

How to check if a select is null

People, I have this code that pulls server info try { $conecta = new PDO("mysql:host=$servidor;dbname=$banco", $usuario, $senha); $consulta = $conecta->prepare('SELECT * FROM tb02_cardapiosem WHERE tb02_diasemana=' . $data); $c...
asked by 12.10.2017 / 15:00
2
answers

List all the data of a search

How to list all the data in this query, I can only display the first line but I want to query all of them and show them. public function gerarCardapio(){ try{ $cat = "M"; $sql = "SELECT * FROM alimentos WHERE id...
asked by 15.10.2017 / 00:47
1
answer

Abstraction of the Connection PHP PDO class

Personal I have the following class for connecting to database ... namespace App\Database; class Conn { public static function getDb() { return new \PDO('mysql:host=localhost;dbname=dkse','root','root'); } } It's a very...
asked by 04.07.2017 / 00:13
1
answer

Listing data from a table with PHP

Hello, I'm trying to make a listing with data in a table with the code below, but I'm not getting it. I've done it in several ways, I've seen tutorials on the internet and everything, but it does not work. On the server both local and external n...
asked by 11.02.2017 / 00:33