Questions tagged as 'pdo'

1
answer

How to update the PDO database after running a Javascript countdown function

I'm doing a countdown Javascript, and I would like it when the count is == 0 , run a update in the database where it would go add a value <script type="text/javascript"> var count=new Number(); var count=<?php echo $time ?>...
asked by 18.02.2017 / 22:32
0
answers

How to remove error Parse error: syntax error, unexpected 'public'

Hello, I would like to know how I can get this error out of my query <?phppublicfunctionRetornaAtualizacoes(){if($_SERVER['REQUEST_METHOD']=='POST'){try{$Query="SELECT s.setor, s.usuario, s...
asked by 26.12.2016 / 16:25
2
answers

Data not being written to DB by PHP

I'm studying object-oriented PHP and, from some tutorials taken from the net (pdo, pojo, Dao ...), I made a very simple system in which I get the value entered in <input type="text"> and write to the database. data. By the way, y...
asked by 18.01.2017 / 17:26
0
answers

Uncaught exception 'PDOException' with message 'SQLSTATE [23000]: Integrity constraint violation: 1048

I'm trying to make a simple insertion into the database, as I've done several times, using PDO and I can not! What's wrong? PHP: <?php include_once("con.php"); $pdo = conectar(); $data = file_get_contents("php://input"); $data = json_d...
asked by 06.01.2017 / 19:31
0
answers

How to check if it has not already been inserted in PDO?

I need to check if it was already registered before entering the database, as you can see, I get an array of software and I need to validate all before inserting. Basically it would include this line $dbh->prepare("select 1 from softwares...
asked by 16.12.2016 / 18:28
1
answer

Problems with SQL Server 2008 encoding

I am performing a query on a Sql Server database, however the special characters are returned as follows: MAR�O instead of MARÇO I was able to fix using the utf8_encode() function, but I do not want to have to deal with each res...
asked by 14.11.2016 / 20:01
1
answer

Error 403 - access forbidden in password validation with Mysql in PHP7 code, how to fix?

Good afternoon guys, I'm taking a course on a PHP real estate portal system that I bought and I packed up for the portal login system. The course uses PHP below version 5 and the instructor uses the automatic login script generation in msql from...
asked by 13.11.2016 / 00:03
0
answers

How to search a single field of 3 tables with JOIN using Respect \ Relational?

I'm starting to use the Respect\Relational framework and I was just trying to fetch the names of the letter templates that belong to the id 1 business line, but all the forms I've tried always return all the columns. What would be the cor...
asked by 10.11.2016 / 20:50
1
answer

How to pass the value of a "$ variable" from another page, and use it in a select PDO

Next, first I would like to know if it is possible to receive a value from a variable from another page, by session_start() , and apply it to a select. I'm doing it this way: At the top of the page where I want to add select, I've ad...
asked by 30.11.2016 / 14:38
0
answers

See table by date

I have a table that data is written as follows: ID CANAL VALOR DATA 25 10 50 2016-10-14 14:10:05 26 11 12 2016-10-14 14:10:06 27 10 51 2016-10-14 15:10:10 Both records are recorded hourly, so I need to look at them and sho...
asked by 14.10.2016 / 21:57