Questions tagged as 'pdo'

1
answer

I can not declare variable inside id

@$c_id = $_POST['numero']; @$data_aa = $_POST['data_aa']; // Data esta vazio if($data_aa == ''){ $var = "oi"; echo "$var"; } If I put the variable $var out of if() , it works normally.     
asked by 16.09.2018 / 04:06
0
answers

How to use PDO and PHP to Display in Search Data Table

I have a question. I do not understand why my code is not correct. Please, if you can review it, I would be very happy. <?php require_once "db_connect.php"; //conectar banco $conectar = new PDO("mysql:host=$host;bancodedados=$b...
asked by 10.09.2018 / 21:38
0
answers

MySql hangs when trying to query table with many records (PHP)

I'm trying to make a filter where the query is done in a table where the id of the last record is in the number 468.466 . In the filter, I need to compare with a View, which has its last record id 5,303,345 . The query is as follows: S...
asked by 27.08.2018 / 14:13
0
answers

Update div only with ajax

I have a ajax code that sorts items from my table, what I need is for it to refresh only the div                               ID            Image            Name              Slug              Order             Situation             Action  ...
asked by 04.08.2018 / 23:57
1
answer

Error trying to insert - Call a member function prepare () on a non-object

I'm trying to check if a field is repeated in the database, but when I run the file, I get the following error: Fatal error: Call to a member function prepare() on a non-object in ***** on line 39 My code line 39 is as follows: $stm = $pd...
asked by 21.07.2018 / 16:35
0
answers

ERR_TOO_MANY_REDIRECTS WAMPSERVER

I have this problem ERR_TOO_MANY_REDIRECTS on localhost, the script it runs perfectly on the server. I am using Wampserver 3.0 and PHP version 7.0. Here is the script: require_once('header.php'); // Preventing the direct access of this page....
asked by 21.07.2018 / 17:03
0
answers

Webslesson CRUD with PDO, Ajax and dataTable - Does not add data in Mysql after column addition in table

Hello! I'm following a CRUD tutorial with PDO, Ajax and Modal Bootstrap for implementation in a project. My database has 2 tables ( users ) and ( type_ps ). The users table has the following structure: CREATE TABLE 'users' ( 'id' int...
asked by 20.07.2018 / 04:07
0
answers

Value returned from procedure (PDO)

The procedure is running fine, but in case I am not able to get the value it returns, I already looked in the php documentation link , but not yet. function static function inserirCliente($cpf, $nome, $sobrenome, $usuario, $senha) { $...
asked by 06.07.2018 / 23:16
1
answer

How to create a request via GET

This attribute below is working with href , and directing me to the page you want. <a href="prod_detalhe_5.php?codigo=<?php echo $res['codigo']; ?>"> <img src="img_produtos/<?php echo $res['img01']; ?>" /> </a&g...
asked by 07.07.2018 / 15:01
2
answers

Receiving HTTP POST Json with PHP MYSQL PDO

I'm having trouble solving a problem and I'm counting on your help. I am getting, from an external API, an HTTP POST request in JSON format with some information. I need to get this information separately and do an UPDATE on MYSQL using PDO. The...
asked by 10.07.2018 / 16:52