Questions tagged as 'php'

2
answers

How to send string variables as parameter for Ajax call?

The following Ajax call would send to PHP the parameters corresponding to the form that called the function: var foo = "bar"; var bar = "foo"; function register(){ $.ajax({ method: "post", url: "meu_script.php", data: $("#form")...
asked by 26.03.2014 / 18:52
2
answers

preg_match (...) for various types of text

How can I validate the texts below? Letters (including accents) and numbers (without spacing), separated by. or,. ex: 'hello' Whole numbers and / or tenths. ex: '22' or '2.2'     
asked by 29.08.2016 / 11:48
2
answers

Retrieve data in PHP within a text

I have the following text: $texto = "Olá {cliente}, seja bem vindo ao site {site}! Aqui você terá acesso as seguintes opções: {opcoes} Estes dados foram gerados automaticamente em {data} Pela empresa {empresa}"; Note that we have several...
asked by 26.08.2016 / 15:48
2
answers

Return record with the highest number of appearances

Well, I would like to know how to return the record with the field with the highest number of occurrences in a phpMyAdmin database table. See the following image: Iwouldliketoget" Joao ". I tried using mysql_num_rows , but I was n...
asked by 27.08.2016 / 20:02
1
answer

Error date_diff PHP

I am doing a test, with an Oracle database query (writing sysdate, result: 13/09/2016 13:24:44) and returning me in PHP. I need to calculate the difference in hours and I was trying the function below: $date_a = new DateTime($p_fim[$passo]); $...
asked by 13.09.2016 / 18:43
1
answer

Value of a query to a numeric field returns non-numeric

I am trying to read a field in a table that is of integer type. And it's also a primary key and auto-increment. The returned value is put in a label (already tried to put in an input text too). To read the target table and put the result i...
asked by 23.03.2014 / 15:11
2
answers

Add value to a checkbox Instantly

As I'm not very familiar with javascript, I'd like some help on how I can do this calculation script, I'd like that when I click on each checkbox it automatically shows me the result on the screen, adding up all the marked and a subtraction of a...
asked by 29.08.2015 / 17:30
1
answer

How to close a connection to the database using PDO?

I'm new to the PHP development area and my app uses a method to open a connection to the database in MySQL , I'm looking to update and display the records. I need to use some method to close the connection, type: function close() ? p...
asked by 31.08.2015 / 15:40
2
answers

Error codeigniter 3: Undefined variable: alert

I'm doing the recording in the bank received from a form, it's recording, but I want a message to appear after the recording, which was received successfully. But you are giving the error below. I've been locked in this for 2 days, I do not know...
asked by 09.09.2015 / 21:33
1
answer

Doubts about PHP function 'end'

My question is in $extensao , where it contains a parenthesis at the beginning and at the end. What's the point of being there? $extensao = ( end ( explode ('.', $_FILES [ "img" ][ "name"] ) ) ) ; $imagem = md5 ( uniqid ( $_FILES [ "img...
asked by 01.09.2015 / 23:09