Questions tagged as 'php'

2
answers

Counting strings reached PDO

I'm doing a query and need to count the number of rows returned, I'm not usually accustomed to doing this in PDO, follow my code below. $sqlCODCEL = $conn->prepare("SELECT * FROM tbl_CELULAS WHERE TXT_CODIG_SECUR = :codCEL"); $sqlCODCEL->...
asked by 24.08.2015 / 13:47
2
answers

Read XML received from ajax - PHP

In php using the command var_dump($_FILES ['filexml']); I get the following ajax values array(5) { ["name"]=> string(56) "nomeficticio.xml" ["type"]=> string(8) "text/xml" ["tmp_name"]=> string(14) "/tmp/phpoqnomefi...
asked by 10.09.2015 / 15:07
1
answer

Send GET parameters to a php using the exec command

I'm trying to send GET parameters to a php using the php exec command, but when I put the parameters the script does not run, it does not get to the other php, follow my code: exec.php: $cmd = 'php teste.php?id=10,11'; $pid = exec($cmd.'...
asked by 05.09.2018 / 15:59
1
answer

Assignment in conditional test in PHP

I'm studying PHP and I came across a feature that does not exist in Python (I do not know in other languages), which is the assignment in a conditional test: $file = fopen("arquivo.txt", "w"); while($row = fgets($file)){ ... } Correct...
asked by 27.08.2018 / 20:18
1
answer

Data returned in an array is duplicated

I'm running a SELECT in the database through a function and returning the result as a multidimensional array, where each primary index refers to a record, and the secondary indexes are the bank fields with the values. Below is the function re...
asked by 08.03.2018 / 14:07
1
answer

Merge two arrays

I have the arrays : $tamanho = ['P', 'M', 'G']; $quantidade = [1, 3, 5]; The end result would have to look like this: $final = [ ["tamanho" => 'P', "quantidade" => 1], ["tamanho" => 'M', "quantidade" =>...
asked by 28.02.2018 / 17:49
2
answers

Add or subtract value, depending on the type of posting (MSSQL)

I have the following query: SELECT MOVTIPOPRODUTO.ID_ENTIDADE, ENTIDADE.NOMECLIENTE, PRODUTO.NOMEPRODUTO, TIPOPRODUTO.DESCRICAO, MOVTIPOPRODUTO.ID_PRODUTO, MOVTIPOPRODUTO.ID_TIPOPRODUTO, MOVTIPOPRODUTO.ID_SAFRA, MOVTIPOPRODUTO.ID_LOCALE...
asked by 23.07.2018 / 14:27
2
answers

Mount INSERT from SELECT

I would like to make a select and from it generate insert . I want to start from the preposto that I do not know the table structure, the number of columns, nothing more than the table name. select * from cliente where nome like '...
asked by 07.08.2018 / 19:56
1
answer

Identify screen size to load content asynchronously

I have a script that does reload every 10 seconds, loading a page into a div : <script type="text/javascript"> var tempo = 10000; function listar() { $.ajax({ url:"lista.php", success...
asked by 20.07.2018 / 13:15
1
answer

How to upload using PHP image in BLOB link?

I'm making use of a GitHub (xkeshi / image-compressor) project that compresses images using JavaScript. It generates a download of the compressed file with the following link for example blob:http://localhost/945f825f-054a-4170-9d79-ac1dba593...
asked by 04.08.2018 / 03:09