Questions tagged as 'php'

1
answer

MySQL query with PDO does not return data

I have the following problem. I developed a PHP class for a site I'm creating and in one of those functions I'm having a problem with the PDO. When giving the command SELECT I use the rowCount () function to check if it has obtained resul...
asked by 30.12.2016 / 07:31
2
answers

Assigned operator

I can not understand why it does not execute the expression I want. Follow the code: $i = 1; $ranking = 1; $r = 0; for($i = 1; $i <=5; $i++){ $p = isset($_GET["n$i"])?$_GET["n$i"]:0; echo "$ranking ° Numero: $p"; $r += $p;...
asked by 05.01.2017 / 16:58
4
answers

Loop autoincrementing date

How can I make a auto increment of date by month and showing the last day of the month Example:    2017-01-31       2017-02-28       2017-03-31 $parcelas = 12; $data_inicial = 2017-01-31 for ($i = 1; $i <= $parcelas; $i++){...
asked by 20.12.2016 / 17:12
1
answer

Is there any difference between saving the settings in dotEnv, JSON or INI?

To save sensitive data from the application, is it recommended to save in dotEnv or can I save it in any other format since the file is not in the public directory? I see many talking about dotEnv, I wanted to know why they say it's so secure...
asked by 11.01.2017 / 00:14
1
answer

Wide Angle API

I am trying to make a request using angular connecting to REST API built in laravel. XMLHttpRequest cannot load http://localhost:8000/rest/v1/entidades/licitacoes. No 'Access-Control-Allow-Origin' header is present on the requested resource....
asked by 21.06.2016 / 20:31
1
answer

Problems with PHP connection - MySQL

Error    Warning: mysqli_connect () [function.mysqli-connect]: (HY000 / 1130): Host '10 .1.1.25 'is not allowed to connect to this MySQL server in /home/a1570220/public_html/register.php on line 2       Warning: mysqli_prepare () expects p...
asked by 20.08.2016 / 09:49
1
answer

How to do While from one table and show data from another?

I have two tables: Tabela1: Id int A_I; Modelo varchar; Tabela2: Id int A_I; Id_fk int (foreign key da tabela1); cor; And I wanted to do a while from table1 but display the data from table2. <?php include 'conn.php'; mys...
asked by 26.08.2016 / 11:37
1
answer

Limit inputs dynamically

I'm a little new to jQuery and would like to know how I can restrict the size of input dynamically inserted. An example: In the code below, the user can insert as many% s as you want, but I wanted to limit these inserts. Is it possi...
asked by 23.08.2016 / 22:16
1
answer

mysqli_query returns false to select done with REGEXP

I'm having the following problem: I'm trying to capture a table row from my database using a regex, and by typing the code into the Mysql terminal, it catches the line normally. In my php code, mysqli_query () always returns false with these sam...
asked by 10.06.2016 / 01:55
2
answers

Insert in mysql with strtoupper is not accepting numbers and letters

I'm doing the following insert: <?php include "conexao.php"; $v_tipo = $_POST ["tipo"]; $v_funcao = $_POST ["funcao"]; $v_numero = $_POST ["numero"]; $v_responsavel = strtoupper($_POST['responsavel']); $v_tag...
asked by 10.05.2016 / 17:02